[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yoapk4osojwJyrxM@sol.localdomain>
Date: Thu, 19 May 2022 13:33:23 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-ext4@...r.kernel.org, Theodore Ts'o <tytso@....edu>
Subject: Re: [tytso-ext4:dev 17/25] fs/ext4/super.c:2799:29: warning: unused
variable 'sbi'
On Fri, May 20, 2022 at 04:12:21AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
> head: b76a7dd9a7437e8c21253ce3a7574bebde3827f9
> commit: 0df27ddf69f38e5ab1e1c73e46c35eecc6ca1609 [17/25] ext4: only allow test_dummy_encryption when supported
> config: i386-randconfig-a004 (https://download.01.org/0day-ci/archive/20220520/202205200431.kzojEoNc-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e00cbbec06c08dc616a0d52a20f678b8fbd4e304)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=0df27ddf69f38e5ab1e1c73e46c35eecc6ca1609
> git remote add tytso-ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
> git fetch --no-tags tytso-ext4 dev
> git checkout 0df27ddf69f38e5ab1e1c73e46c35eecc6ca1609
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/ext4/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
>
> All warnings (new ones prefixed by >>):
>
> >> fs/ext4/super.c:2799:29: warning: unused variable 'sbi' [-Wunused-variable]
> const struct ext4_sb_info *sbi = EXT4_SB(sb);
> ^
> 1 warning generated.
>
>
> vim +/sbi +2799 fs/ext4/super.c
>
> 2794
> 2795 static int ext4_check_test_dummy_encryption(const struct fs_context *fc,
> 2796 struct super_block *sb)
> 2797 {
> 2798 const struct ext4_fs_context *ctx = fc->fs_private;
> > 2799 const struct ext4_sb_info *sbi = EXT4_SB(sb);
> 2800
> 2801 if (!IS_ENABLED(CONFIG_FS_ENCRYPTION) ||
> 2802 !(ctx->spec & EXT4_SPEC_DUMMY_ENCRYPTION))
> 2803 return 0;
> 2804
> 2805 if (!ext4_has_feature_encrypt(sb)) {
> 2806 ext4_msg(NULL, KERN_WARNING,
> 2807 "test_dummy_encryption requires encrypt feature");
> 2808 return -EINVAL;
> 2809 }
> 2810 /*
> 2811 * This mount option is just for testing, and it's not worthwhile to
> 2812 * implement the extra complexity (e.g. RCU protection) that would be
> 2813 * needed to allow it to be set or changed during remount. We do allow
> 2814 * it to be specified during remount, but only if there is no change.
> 2815 */
> 2816 if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
> 2817 !DUMMY_ENCRYPTION_ENABLED(sbi)) {
> 2818 ext4_msg(NULL, KERN_WARNING,
> 2819 "Can't set test_dummy_encryption on remount");
> 2820 return -EINVAL;
> 2821 }
> 2822 return 0;
> 2823 }
> 2824
That's kind of annoying; it's because DUMMY_ENCRYPTION_ENABLED() is a macro that
doesn't use its argument when !CONFIG_FS_ENCRYPTION.
I'll send a new version of this patch that just makes the contents of
ext4_check_test_dummy_encryption() be conditional on CONFIG_FS_ENCRYPTION.
This will be temporary, as the ifdef will go away later in "ext4: fix up
test_dummy_encryption handling for new mount API".
- Eric
Powered by blists - more mailing lists