tree: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git testing head: a1a6c3d7c1edb81c0b4b20b44f0f4e7214c92116 commit: a1a6c3d7c1edb81c0b4b20b44f0f4e7214c92116 [12/12] pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231005/202310050440.0XpKt47j-lkp@xxxxxxxxx/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231005/202310050440.0XpKt47j-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202310050440.0XpKt47j-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): fs/nfs/flexfilelayout/flexfilelayout.c:1230:6: warning: variable 'err' set but not used [-Wunused-but-set-variable] int err; ^ >> fs/nfs/flexfilelayout/flexfilelayout.c:2536:13: error: use of undeclared identifier 'inode' lo = NFS_I(inode)->layout; ^ 1 warning and 1 error generated. vim +/inode +2536 fs/nfs/flexfilelayout/flexfilelayout.c 2522 2523 static int ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) 2524 { 2525 struct pnfs_layout_hdr *lo; 2526 struct nfs4_flexfile_layout *ff_layout; 2527 const int dev_count = PNFS_LAYOUTSTATS_MAXDEV; 2528 2529 /* For now, send at most PNFS_LAYOUTSTATS_MAXDEV statistics */ 2530 args->devinfo = kmalloc_array(dev_count, sizeof(*args->devinfo), 2531 nfs_io_gfp_mask()); 2532 if (!args->devinfo) 2533 return -ENOMEM; 2534 2535 spin_lock(&args->inode->i_lock); > 2536 lo = NFS_I(inode)->layout; 2537 if (lo && pnfs_layout_is_valid(lo)) { 2538 ff_layout = FF_LAYOUT_FROM_HDR(lo); 2539 args->num_dev = ff_layout_mirror_prepare_stats( 2540 &ff_layout->generic_hdr, &args->devinfo[0], dev_count, 2541 NFS4_FF_OP_LAYOUTSTATS); 2542 } else 2543 args->num_dev = 0; 2544 spin_unlock(&args->inode->i_lock); 2545 if (!args->num_dev) { 2546 kfree(args->devinfo); 2547 args->devinfo = NULL; 2548 return -ENOENT; 2549 } 2550 2551 return 0; 2552 } 2553 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki