From: kernel test robot <[email protected]>
To: Ammar Faizi <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Cc: [email protected]
Subject: [ammarfaizi2-block:google/android/kernel/common/android13-5.10 9677/9999] fs/fuse/backing.c:984:35: warning: variable 'fc' set but not used
Date: Tue, 20 Sep 2022 13:00:59 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
Hi Paul,
FYI, the error/warning still remains.
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android13-5.10
head: aadf7ad9db2f7d93ecfb34d0e4f328519460c94e
commit: 8efdff35e3052e44d519ccfb9d50594f5df0240b [9677/9999] ANDROID: fuse-bpf: Move fd operations to be synchronous
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220920/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/ammarfaizi2/linux-block/commit/8efdff35e3052e44d519ccfb9d50594f5df0240b
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android13-5.10
git checkout 8efdff35e3052e44d519ccfb9d50594f5df0240b
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/fuse/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
All warnings (new ones prefixed by >>):
fs/fuse/backing.c: In function 'fuse_lookup_finalize':
>> fs/fuse/backing.c:984:35: warning: variable 'fc' set but not used [-Wunused-but-set-variable]
984 | struct fuse_conn *fc;
| ^~
fs/fuse/backing.c: In function 'fuse_statfs_initialize':
fs/fuse/backing.c:1771:32: warning: initialized field overwritten [-Woverride-init]
1771 | .out_numargs = 1,
| ^
fs/fuse/backing.c:1771:32: note: (near initialization for '(anonymous).out_numargs')
vim +/fc +984 fs/fuse/backing.c
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 911
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 912 struct dentry *fuse_lookup_finalize(struct fuse_args *fa, struct inode *dir,
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 913 struct dentry *entry, unsigned int flags)
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 914 {
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 915 struct fuse_dentry *fd;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 916 struct dentry *bd;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 917 struct inode *inode, *backing_inode;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 918 struct fuse_entry_out *feo = fa->out_args[0].value;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 919 struct fuse_entry_bpf_out *febo = fa->out_args[1].value;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 920
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 921 fd = get_fuse_dentry(entry);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 922 if (!fd)
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 923 return ERR_PTR(-EIO);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 924 bd = fd->backing_path.dentry;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 925 if (!bd)
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 926 return ERR_PTR(-ENOENT);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 927 backing_inode = bd->d_inode;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 928 if (!backing_inode)
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 929 return 0;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 930
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 931 inode = fuse_iget_backing(dir->i_sb, backing_inode);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 932
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 933 if (IS_ERR(inode))
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 934 return ERR_PTR(PTR_ERR(inode));
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 935
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 936 /* TODO Make sure this handles invalid handles */
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 937 /* TODO Do we need the same code in revalidate */
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 938 if (get_fuse_inode(inode)->bpf) {
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 939 bpf_prog_put(get_fuse_inode(inode)->bpf);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 940 get_fuse_inode(inode)->bpf = NULL;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 941 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 942
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 943 switch (febo->bpf_action) {
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 944 case FUSE_ACTION_KEEP:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 945 get_fuse_inode(inode)->bpf = get_fuse_inode(dir)->bpf;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 946 if (get_fuse_inode(inode)->bpf)
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 947 bpf_prog_inc(get_fuse_inode(inode)->bpf);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 948 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 949
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 950 case FUSE_ACTION_REMOVE:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 951 get_fuse_inode(inode)->bpf = NULL;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 952 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 953
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 954 case FUSE_ACTION_REPLACE: {
8efdff35e3052e4 Paul Lawrence 2022-03-04 955 struct file *bpf_file = (struct file*) febo->bpf_fd;
8efdff35e3052e4 Paul Lawrence 2022-03-04 956 struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL);
8efdff35e3052e4 Paul Lawrence 2022-03-04 957
8efdff35e3052e4 Paul Lawrence 2022-03-04 958 if (bpf_file && !IS_ERR(bpf_file))
8efdff35e3052e4 Paul Lawrence 2022-03-04 959 bpf_prog = fuse_get_bpf_prog(bpf_file);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 960
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 961 if (IS_ERR(bpf_prog))
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 962 return ERR_PTR(PTR_ERR(bpf_prog));
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 963
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 964 get_fuse_inode(inode)->bpf = bpf_prog;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 965 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 966 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 967
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 968 default:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 969 return ERR_PTR(-EIO);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 970 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 971
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 972 switch (febo->backing_action) {
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 973 case FUSE_ACTION_KEEP:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 974 /* backing inode/path are added in fuse_lookup_backing */
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 975 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 976
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 977 case FUSE_ACTION_REMOVE:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 978 iput(get_fuse_inode(inode)->backing_inode);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 979 get_fuse_inode(inode)->backing_inode = NULL;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 980 path_put_init(&get_fuse_dentry(entry)->backing_path);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 981 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 982
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 983 case FUSE_ACTION_REPLACE: {
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 @984 struct fuse_conn *fc;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 985 struct file *backing_file;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 986
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 987 fc = get_fuse_mount(dir)->fc;
8efdff35e3052e4 Paul Lawrence 2022-03-04 988 backing_file = (struct file *) febo->backing_fd;
8efdff35e3052e4 Paul Lawrence 2022-03-04 989 if (!backing_file || IS_ERR(backing_file))
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 990 return ERR_PTR(-EIO);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 991
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 992 iput(get_fuse_inode(inode)->backing_inode);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 993 get_fuse_inode(inode)->backing_inode =
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 994 backing_file->f_inode;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 995 ihold(get_fuse_inode(inode)->backing_inode);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 996
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 997 path_put(&get_fuse_dentry(entry)->backing_path);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 998 get_fuse_dentry(entry)->backing_path = backing_file->f_path;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 999 path_get(&get_fuse_dentry(entry)->backing_path);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1000
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1001 fput(backing_file);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1002 break;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1003 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1004
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1005 default:
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1006 return ERR_PTR(-EIO);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1007 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1008
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1009 get_fuse_inode(inode)->nodeid = feo->nodeid;
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1010
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1011 return d_splice_alias(inode, entry);
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1012 }
6be5b06e4195b00 Daniel Rosenberg 2021-12-02 1013
:::::: The code at line 984 was first introduced by commit
:::::: 6be5b06e4195b002c52a1c2c82573ea7a76ce111 ANDROID: fuse-bpf v1
:::::: TO: Daniel Rosenberg <[email protected]>
:::::: CC: Paul Lawrence <[email protected]>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-09-20 5:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox