[LU-17027] missing #include <linux/file.h> in lustre/target/tgt_mount.c Created: 15/Aug/23  Updated: 24/Aug/23  Resolved: 24/Aug/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Xinliang Liu Assignee: Xinliang Liu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-15396 missing <linux/file.h> in osd-ldiskfs Resolved
is related to LU-137 ioctl passthrough mechanism for Lustr... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

commit "ac0380dc51 LU-137 osd-ldiskfs: pass through resize ioctl" introduces alloc_file_pseudo() to lustre/target/tgt_mount.c which needs to inclucde <linux/file.h> for 4.19 kernel.

4.19.90 kernel build fails:

make[3]: Entering directory '/usr/src/kernels/4.19.90-2308.1.0.0212.oe1.aarch64'
  CC [M]  /home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.o
/home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.c: In function ‘server_ioctl’:
/home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.c:1971:14: error: implicit declaration of function ‘alloc_file_pseudo’; did you mean ‘alloc_pipe_info’? [-Werror=implicit-function-declaration]
  root_filp = alloc_file_pseudo(root_inode, root_mnt, "/",
              ^~~~~~~~~~~~~~~~~
              alloc_pipe_info
/home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.c:1971:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  root_filp = alloc_file_pseudo(root_inode, root_mnt, "/",
            ^
/home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.c:1975:2: error: implicit declaration of function ‘fput’; did you mean ‘iput’? [-Werror=implicit-function-declaration]
  fput(root_filp);
  ^~~~
  iput
/home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-stringop-truncation’
cc1: some warnings being treated as errors
make[6]: *** [scripts/Makefile.build:304: /home/openeuler/lustre-release/lustre/ptlrpc/../../lustre/target/tgt_mount.o] Error 1
make[5]: *** [scripts/Makefile.build:544: /home/openeuler/lustre-release/lustre/ptlrpc] Error 2
make[4]: *** [scripts/Makefile.build:544: /home/openeuler/lustre-release/lustre] Error 2
make[3]: *** [Makefile:1524: _module_/home/openeuler/lustre-release] Error 2
make[3]: Leaving directory '/usr/src/kernels/4.19.90-2308.1.0.0212.oe1.aarch64'
make[2]: *** [autoMakefile:1167: modules] Error 2
make[2]: Leaving directory '/home/openeuler/lustre-release'
make[1]: *** [autoMakefile:704: all-recursive] Error 1
make[1]: Leaving directory '/home/openeuler/lustre-release'
make: *** [autoMakefile:568: all] Error 2
[openeuler@oe2003-test lustre-release]$  


 Comments   
Comment by Gerrit Updater [ 15/Aug/23 ]

"xinliang <xinliang.liu@linaro.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51943
Subject: LU-17027 target: include linux/file.h
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c401791131742bf70446c9795eafdaa9730104ec

Comment by Gerrit Updater [ 24/Aug/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51943/
Subject: LU-17027 target: include linux/file.h
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2031b2608d1b195e079d11411bb4747a10b340e1

Comment by Peter Jones [ 24/Aug/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:32:00 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.