lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202505312056.JEiEGBI7-lkp@intel.com>
Date: Sat, 31 May 2025 20:54:44 +0800
From: kernel test robot <lkp@...el.com>
To: Eric Sandeen <sandeen@...hat.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	linux-kernel@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>
Subject: fs/ufs/super.c:1246:15: warning: variable 'ufstype' set but not used

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0f70f5b08a47a3bc1a252e5f451a137cde7c98ce
commit: b70cb459890b7590c6d909da8c1e7ecfaf6535fb ufs: convert ufs to the new mount API
date:   2 weeks ago
config: i386-buildonly-randconfig-2003-20250531 (https://download.01.org/0day-ci/archive/20250531/202505312056.JEiEGBI7-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250531/202505312056.JEiEGBI7-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505312056.JEiEGBI7-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ufs/super.c:1246:15: warning: variable 'ufstype' set but not used [-Wunused-but-set-variable]
    1246 |         unsigned int ufstype;
         |                      ^
   1 warning generated.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ