Signed-off-by: Erez Zilber <erezz...@gmail.com>
2 comments about this patch:
1. I'm not familiar enough with the fwparam_ibft code, so I didn't add
the -Werror flag to the Makefile. There are still compilation warnings
in that code.
2. I was able to test it on CentOS 5.3 & kubuntu 9.04 only. If anyone
can test it on other kernels and submit fixes, it would be great.
Erez
Thanks.
I get this compilation error on fedora 10. We used to get a warning about it not being initialized and upstream we did this patch. Is this just a bug in my compiler?
@@ -693,6 +692,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
"Too many iscsi targets. Max "
"number of targets is %d.\n",
ISCSI_MAX_TARGET - 1);
+ err = -EOVERFLOW;
goto release_host;
}
}
make
make -C /lib/modules/2.6.29.4-167.fc11.x86_64/build M=`pwd` KBUILD_OUTPUT= V=0 modules
make[1]: Entering directory `/usr/src/kernels/2.6.29.4-167.fc11.x86_64'
CC [M] /home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.o
cc1: warnings being treated as errors
/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.c: In function ‘iscsi_add_session’:
/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.c:678: error: ‘err’ may be used uninitialized in this function
make[2]: *** [/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.o] Error 1
make[1]: *** [_module_/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.29.4-167.fc11.x86_64'
Yeah, this looks strange because err should have been initialized in
the for loop (assuming that ISCSI_MAX_TARGET > 0). Maybe the compiler
doesn't check that (which may be considered a bug/feature ;) ). Do you
want to add this fix also to open-iscsi.git?
Erez
> Yeah, this looks strange because err should have been initialized in
> the for loop (assuming that ISCSI_MAX_TARGET > 0). Maybe the compiler
> doesn't check that (which may be considered a bug/feature ;) ). Do you
> want to add this fix also to open-iscsi.git?
Yes, there are some situations where gcc does not detect that a variable is
initialized. However in most cases gcc is right.
Ulrich
I messed up. I thought we already had the fix, so I was wondering why I
get the compilation error with your patch. I mean I thought your patch
added a new failure somehow. Ignore me :)
OK, so do you want to apply my patch as is + the required fix in
iscsi_add_session?
Erez
Yeah, I was going to apply the iscsi_add_session fix (I was acutally
working on resyncing all the upstream code that was sent for 2.6.32 and
2.6.31 with the open-iscsi/kernel stuff) then your patch.
Just a update on this patch. I was doing more testing and on Fedora 9, I
get:
isns.c: In function ‘build_dev_reg_req’:
isns.c:146: error: dereferencing pointer ‘lss.24’ does break
strict-aliasing rules
isns.c:146: note: initialized from here
isns.c:153: error: dereferencing pointer ‘lss.24’ does break
strict-aliasing rules
isns.c:153: note: initialized from here
isns.c:157: error: dereferencing pointer ‘lss.27’ does break
strict-aliasing rules
isns.c:157: note: initialized from here
make[1]: *** [isns.o] Error 1
make[1]: Leaving directory
`/home/mnc/kernel/iscsi/open-iscsi/devel/tmp/open-iscsi/usr'