Re: Compile problem of core-iscsi on CentOS 5.3 kernel 2.6.18-128.1.10.el5-x86_64

67 views
Skip to first unread message

Nicholas A. Bellinger

unread,
Jun 2, 2009, 7:26:10 PM6/2/09
to linux-iscsi...@googlegroups.com, Core-iSCSI
On Fri, 2009-05-29 at 06:45 -0700, vykupitel wrote:
> Hello Nicholas,
>
> I want to try MC/s with core-iscsi but my compilation end with error.
>
> [root@tux-new coreiscsi-1.6.2]# ./autoconfig --write-to-file
> /root/src/linux-iscsi.org/branches/coreiscsi-1.6.2/.make_autoconfig
> [root@tux-new coreiscsi-1.6.2]# make
> make -C core all
> make[1]: Entering directory `/root/src/linux-iscsi.org/branches/
> coreiscsi-1.6.2/core'
> make -C /lib/modules/2.6.18-128.1.10.el5/build SUBDIRS=/root/src/linux-
> iscsi.org/branches/coreiscsi-1.6.2/core modules CWD=/root/src/linux-
> iscsi.org/branches/coreiscsi-1.6.2/core ARCH=x86_64
> make[2]: Entering directory `/usr/src/kernels/2.6.18-128.1.10.el5-
> x86_64'
> CC [M] /root/src/linux-iscsi.org/branches/coreiscsi-1.6.2/core/
> iscsi_initiator_debug_opcodes.o
> In file included from /root/src/linux-iscsi.org/branches/
> coreiscsi-1.6.2/core/iscsi_protocol.h:22,
> from /root/src/linux-iscsi.org/branches/
> coreiscsi-1.6.2/core/iscsi_initiator_debug_opcodes.c:18:
> /root/src/linux-iscsi.org/branches/coreiscsi-1.6.2/core/
> iscsi_linux_os.h:80: error: redefinition of ‘scsi_set_resid’
> include/scsi/scsi_cmnd.h:153: error: previous definition of
> ‘scsi_set_resid’ was here
> /root/src/linux-iscsi.org/branches/coreiscsi-1.6.2/core/
> iscsi_linux_os.h:85: error: redefinition of ‘scsi_get_resid’
> include/scsi/scsi_cmnd.h:158: error: previous definition of
> ‘scsi_get_resid’ was here
> make[3]: *** [/root/src/linux-iscsi.org/branches/coreiscsi-1.6.2/core/
> iscsi_initiator_debug_opcodes.o] Error 1
> make[2]: *** [_module_/root/src/linux-iscsi.org/branches/
> coreiscsi-1.6.2/core] Error 2
> make[2]: Leaving directory `/usr/src/kernels/2.6.18-128.1.10.el5-
> x86_64'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/root/src/linux-iscsi.org/branches/
> coreiscsi-1.6.2/core'
> make: *** [all] Error 2
>

Hi Lada,

The reason this is breaking is because in kernel.org code the
scsi_set_resid() and scsi_get_resid() functions where added in v2.6.23,
and the "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)" to enable
these in iscsi_linux_os.h is causing the issue with the logic backported
into the CentOS 5.3 kernel.

Here is a patch to stub out the logic in iscsi_linux_os.h

--nab

Index: core/iscsi_linux_os.h
===================================================================
--- core/iscsi_linux_os.h (revision 419)
+++ core/iscsi_linux_os.h (working copy)
@@ -76,6 +76,7 @@
# define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer)
# define scsi_bufflen(cmd) ((cmd)->request_bufflen)

+#if 0
static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
{
cmd->resid = resid;
@@ -86,6 +87,7 @@
return cmd->resid;
}
#endif
+#endif

#endif /*** _ISCSI_INITIATOR_LINUX_OS_H_ ***/


Reply all
Reply to author
Forward
0 new messages