Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scst/include/backport.h: Fix building on RHEL 8.8 #144

Merged
merged 1 commit into from
Apr 3, 2023
Merged

scst/include/backport.h: Fix building on RHEL 8.8 #144

merged 1 commit into from
Apr 3, 2023

Conversation

RobertBlackhart
Copy link
Contributor

As in #77, SCST fails to install on RHEL 8.8 due to duplicate symbols:

[scst-3.7]# make 2release
cd scst && make 2release
make[1]: Entering directory '/root/scst-3.7/scst'
make[1]: Leaving directory '/root/scst-3.7/scst'
[scst-3.7]# make install
if [ install = extraclean ]; then rm -f TAGS tags cscope.out; fi
for d in scst iscsi-scst qla2x00t-32gbit/qla2x00-target srpt        \
        scst_local fcst usr scstadmin; do \
        make -j$(nproc) -C "$d" install || break;                   \
done
make[1]: Entering directory '/root/scst-3.7/scst'
cd src && make install
make[2]: Entering directory '/root/scst-3.7/scst/src'
make -C certs KDIR=/lib/modules/4.18.0-477.el8.x86_64/build                                     \

make[3]: Entering directory '/root/scst-3.7/scst/src/certs'
openssl req -new -nodes -utf8 -sha256 -days 365000 \
        -batch -x509 -config x509.genkey -outform DER -out scst_module_key.der \
        -keyout scst_module_key.priv
openssl req -new -nodes -utf8 -sha256 -days 365000 \
        -batch -x509 -config x509.genkey -outform DER -out scst_module_key.der \
        -keyout scst_module_key.priv
Generating a RSA private key
Generating a RSA private key
..........................................................................+.++.+
..+.+.++
..............................................+.++.+
writing new private key to 'scst_module_key.priv'
-----
..chmod 600 scst_module_key.der
.....++++
writing new private key to 'scst_module_key.priv'
-----
chmod 600 scst_module_key.priv
make[3]: Leaving directory '/root/scst-3.7/scst/src/certs'
make -C /lib/modules/4.18.0-477.el8.x86_64/build M=/root/scst-3.7/scst/src                              \

make[3]: Entering directory '/usr/src/kernels/4.18.0-477.el8.x86_64'
  CC [M]  /root/scst-3.7/scst/src/scst_copy_mgr.o
  CC [M]  /root/scst-3.7/scst/src/scst_debug.o
  CC [M]  /root/scst-3.7/scst/src/scst_dlm.o
  CC [M]  /root/scst-3.7/scst/src/scst_event.o
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_debug.c:31:
/root/scst-3.7/scst/src/../include/backport.h:1474:31: error: redefinition of ‘scsi_cmd_to_rq’
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_debug.c:31:
./include/scsi/scsi_cmnd.h:171:31: note: previous definition of ‘scsi_cmd_to_rq’ was here
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_debug.c:31:
/root/scst-3.7/scst/src/../include/backport.h:1501:19: error: redefinition of ‘scsi_prot_ref_tag’
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_debug.c:31:
./include/scsi/scsi_cmnd.h:327:19: note: previous definition of ‘scsi_prot_ref_tag’ was here
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_copy_mgr.c:17:
/root/scst-3.7/scst/src/../include/backport.h:1474:31: error: redefinition of ‘scsi_cmd_to_rq’
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_copy_mgr.c:17:
./include/scsi/scsi_cmnd.h:171:31: note: previous definition of ‘scsi_cmd_to_rq’ was here
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_copy_mgr.c:17:
/root/scst-3.7/scst/src/../include/backport.h:1501:19: error: redefinition of ‘scsi_prot_ref_tag’
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_copy_mgr.c:17:
./include/scsi/scsi_cmnd.h:327:19: note: previous definition of ‘scsi_prot_ref_tag’ was here
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:317: /root/scst-3.7/scst/src/scst_debug.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_dlm.c:26:
/root/scst-3.7/scst/src/../include/backport.h:1474:31: error: redefinition of ‘scsi_cmd_to_rq’
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_dlm.c:26:
./include/scsi/scsi_cmnd.h:171:31: note: previous definition of ‘scsi_cmd_to_rq’ was here
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_dlm.c:26:
/root/scst-3.7/scst/src/../include/backport.h:1501:19: error: redefinition of ‘scsi_prot_ref_tag’
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_dlm.c:26:
./include/scsi/scsi_cmnd.h:327:19: note: previous definition of ‘scsi_prot_ref_tag’ was here
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:317: /root/scst-3.7/scst/src/scst_copy_mgr.o] Error 1
make[4]: *** [scripts/Makefile.build:317: /root/scst-3.7/scst/src/scst_dlm.o] Error 1
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_event.c:26:
/root/scst-3.7/scst/src/../include/backport.h:1474:31: error: redefinition of ‘scsi_cmd_to_rq’
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_event.c:26:
./include/scsi/scsi_cmnd.h:171:31: note: previous definition of ‘scsi_cmd_to_rq’ was here
 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
                               ^~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:64,
                 from /root/scst-3.7/scst/src/scst_event.c:26:
/root/scst-3.7/scst/src/../include/backport.h:1501:19: error: redefinition of ‘scsi_prot_ref_tag’
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
In file included from /root/scst-3.7/scst/src/../include/scst.h:54,
                 from /root/scst-3.7/scst/src/scst_event.c:26:
./include/scsi/scsi_cmnd.h:327:19: note: previous definition of ‘scsi_prot_ref_tag’ was here
 static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
                   ^~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:317: /root/scst-3.7/scst/src/scst_event.o] Error 1
make[3]: *** [Makefile:1616: _module_/root/scst-3.7/scst/src] Error 2
make[3]: Leaving directory '/usr/src/kernels/4.18.0-477.el8.x86_64'
make[2]: *** [Makefile:75: all] Error 2
make[2]: Leaving directory '/root/scst-3.7/scst/src'
make[1]: *** [Makefile:39: install] Error 2
make[1]: Leaving directory '/root/scst-3.7/scst'
[scst-3.7]#

This diff extends the existing check to cover the new version as well. With the fix, things work as expected:

[scst-3.7]# make install

    ..<snip make output>..

If you want SCST to start automatically at boot time, run the following command:
systemctl enable scst.service

make[1]: Leaving directory '/root/scst-3.7/scstadmin'
[scst-3.7]# systemctl enable scst.service
scst.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable scst
[scst-3.7]# systemctl start scst
[scst-3.7]# systemctl status scst
● scst.service - LSB: SCST - A Generic SCSI Target Subsystem
   Loaded: loaded (/etc/rc.d/init.d/scst; generated)
   Active: active (exited) since Fri 2023-03-31 13:06:44 EDT; 820ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 98636 ExecStart=/etc/rc.d/init.d/scst start (code=exited, status=0/SUCCESS)

Mar 31 13:06:44 sdot-b200-011c-d3 systemd[1]: Starting LSB: SCST - A Generic SCSI Target Subsystem...
Mar 31 13:06:44 sdot-b200-011c-d3 scst[98636]: Loading and configuring SCSTSCST configuration file /etc/scst.conf missing
Mar 31 13:06:44 sdot-b200-011c-d3 scst[98655]: [  OK  ]
Mar 31 13:06:44 sdot-b200-011c-d3 systemd[1]: Started LSB: SCST - A Generic SCSI Target Subsystem.
[scst-3.7]# lsmod | grep scst
scst                 3624960  0
dlm                   221184  1 scst
[scst-3.7]#

scst/include/backport.h Show resolved Hide resolved
scst/include/backport.h Show resolved Hide resolved
@lnocturno
Copy link
Contributor

Hi,

Thank you for the contribution!

Could you optionally add a prefix to your commit, like scst/include/backport.h: Fix ... and a small comment to the commit body.

Thanks,
Gleb.

@RobertBlackhart RobertBlackhart changed the title Fix compilation for RHEL 8.8 scst/include/backport.h: Fix building on RHEL 8.8 Apr 2, 2023
@RobertBlackhart
Copy link
Contributor Author

I edited the title as you suggested and I did add a comment to the commit on my branch, although I'm not sure if that's what you mean by "a small comment to the commit body". Did you mean to add a comment in the backport.h file?

@lnocturno
Copy link
Contributor

I'm not sure if that's what you mean by "a small comment to the commit body". Did you mean to add a comment in the backport.h file?

What I meant was that you should add a comment to the git commit itself, like so

scst/include/backport.h: Fix building on RHEL 8.8

This fixes a compilation issue with RHEL 8.8 in scst/include/backport.h.
This is the same issue as was seen for RHEL 8.7 in
https://github.com/SCST-project/scst/issues/77

You can do this with the git command git commit -e.

Anyway, this is preferable by code style, but in your case, you can leave only the header message.

Also, can I ask you to keep only one commit in the PR (you can use push --force) because when I merge the PR it will rebase all the commits from your branch.

Thanks,
Gleb

This fixes a compilation issue with RHEL 8.8 in scst/include/backport.h.
This is the same issue as was seen for RHEL 8.7 in #77
@RobertBlackhart
Copy link
Contributor Author

I'm not sure if that's what you mean by "a small comment to the commit body". Did you mean to add a comment in the backport.h file?

What I meant was that you should add a comment to the git commit itself, like so

scst/include/backport.h: Fix building on RHEL 8.8

This fixes a compilation issue with RHEL 8.8 in scst/include/backport.h.
This is the same issue as was seen for RHEL 8.7 in
https://github.com/SCST-project/scst/issues/77

You can do this with the git command git commit -e.

Anyway, this is preferable by code style, but in your case, you can leave only the header message.

Also, can I ask you to keep only one commit in the PR (you can use push --force) because when I merge the PR it will rebase all the commits from your branch.

Thanks, Gleb

Yes, understood now. I had used the VSCode web editor and it only allowed for a title message (which I did think was odd). Anyway, I fixed it up and squashed the commits together.

@lnocturno lnocturno merged commit 9be09fd into SCST-project:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants