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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241107094040.2gcshh466b7zslva@quack3>
Date: Thu, 7 Nov 2024 10:40:40 +0100
From: Jan Kara <jack@...e.cz>
To: Jeff Layton <jlayton@...nel.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
	Josef Bacik <josef@...icpanda.com>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] fs: add the ability for statmount() to report the
 mount devicename

On Wed 06-11-24 14:53:06, Jeff Layton wrote:
> /proc/self/mountinfo displays the devicename for the mount, but
> statmount() doesn't yet have a way to return it. Add a new
> STATMOUNT_MNT_DEVNAME flag, claim the 32-bit __spare1 field to hold the
> offset into the str[] array. STATMOUNT_MNT_DEVNAME will only be set in
> the return mask if there is a device string.
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>

Just one question below:

> @@ -5078,6 +5091,12 @@ static int statmount_string(struct kstatmount *s, u64 flag)
>  		if (seq->count == sm->fs_subtype)
>  			return 0;
>  		break;
> +	case STATMOUNT_MNT_DEVNAME:
> +		sm->mnt_devname = seq->count;
> +		ret = statmount_mnt_devname(s, seq);
> +		if (seq->count == sm->mnt_devname)

Why this odd check? Why don't you rather do:
		if (ret)
?

> +			return ret;
> +		break;
>  	default:
>  		WARN_ON_ONCE(true);
>  		return -EINVAL;

								Honza

-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ