[viro-vfs:work.ufs 3/3] fs/ufs/super.c:1246:22: warning: variable 'ufstype' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.ufs
head:   d6ae2b2cfce0ae88189b7e6a2d2bf5109b5de0af
commit: 8cfcc910ecb377c1be493019dc67c42fa783b734 [3/3] ufs: convert ufs to the new mount API
config: csky-randconfig-002-20250118 (https://download.01.org/0day-ci/archive/20250118/202501181533.2SkfgJga-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250118/202501181533.2SkfgJga-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/202501181533.2SkfgJga-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   fs/ufs/super.c: In function 'ufs_reconfigure':
>> fs/ufs/super.c:1246:22: warning: variable 'ufstype' set but not used [-Wunused-but-set-variable]
    1246 |         unsigned int ufstype;
         |                      ^~~~~~~


vim +/ufstype +1246 fs/ufs/super.c

  1238	
  1239	static int ufs_reconfigure(struct fs_context *fc)
  1240	{
  1241		struct ufs_sb_private_info * uspi;
  1242		struct ufs_super_block_first * usb1;
  1243		struct ufs_super_block_third * usb3;
  1244		struct ufs_fs_context *ctx = fc->fs_private;
  1245		struct super_block *sb = fc->root->d_sb;
> 1246		unsigned int ufstype;
  1247		unsigned int flags;
  1248	
  1249		sync_filesystem(sb);
  1250		mutex_lock(&UFS_SB(sb)->s_lock);
  1251		uspi = UFS_SB(sb)->s_uspi;
  1252		flags = UFS_SB(sb)->s_flags;
  1253		usb1 = ubh_get_usb_first(uspi);
  1254		usb3 = ubh_get_usb_third(uspi);
  1255		
  1256		ufstype = UFS_SB(sb)->s_flavour;
  1257	
  1258		if ((bool)(fc->sb_flags & SB_RDONLY) == sb_rdonly(sb)) {
  1259			UFS_SB(sb)->s_on_err = ctx->on_err;
  1260			mutex_unlock(&UFS_SB(sb)->s_lock);
  1261			return 0;
  1262		}
  1263		
  1264		/*
  1265		 * fs was mouted as rw, remounting ro
  1266		 */
  1267		if (fc->sb_flags & SB_RDONLY) {
  1268			ufs_put_super_internal(sb);
  1269			usb1->fs_time = ufs_get_seconds(sb);
  1270			if ((flags & UFS_ST_MASK) == UFS_ST_SUN
  1271			  || (flags & UFS_ST_MASK) == UFS_ST_SUNOS
  1272			  || (flags & UFS_ST_MASK) == UFS_ST_SUNx86) 
  1273				ufs_set_fs_state(sb, usb1, usb3,
  1274					UFS_FSOK - fs32_to_cpu(sb, usb1->fs_time));
  1275			ubh_mark_buffer_dirty (USPI_UBH(uspi));
  1276			sb->s_flags |= SB_RDONLY;
  1277		} else {
  1278		/*
  1279		 * fs was mounted as ro, remounting rw
  1280		 */
  1281	#ifndef CONFIG_UFS_FS_WRITE
  1282			pr_err("ufs was compiled with read-only support, can't be mounted as read-write\n");
  1283			mutex_unlock(&UFS_SB(sb)->s_lock);
  1284			return -EINVAL;
  1285	#else
  1286			if (ufstype != UFS_MOUNT_UFSTYPE_SUN && 
  1287			    ufstype != UFS_MOUNT_UFSTYPE_SUNOS &&
  1288			    ufstype != UFS_MOUNT_UFSTYPE_44BSD &&
  1289			    ufstype != UFS_MOUNT_UFSTYPE_SUNx86 &&
  1290			    ufstype != UFS_MOUNT_UFSTYPE_UFS2) {
  1291				pr_err("this ufstype is read-only supported\n");
  1292				mutex_unlock(&UFS_SB(sb)->s_lock);
  1293				return -EINVAL;
  1294			}
  1295			if (!ufs_read_cylinder_structures(sb)) {
  1296				pr_err("failed during remounting\n");
  1297				mutex_unlock(&UFS_SB(sb)->s_lock);
  1298				return -EPERM;
  1299			}
  1300			sb->s_flags &= ~SB_RDONLY;
  1301	#endif
  1302		}
  1303		UFS_SB(sb)->s_on_err = ctx->on_err;
  1304		mutex_unlock(&UFS_SB(sb)->s_lock);
  1305		return 0;
  1306	}
  1307	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux