From nobody Thu Mar 5 08:42:21 2026 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B8962D7DD5 for ; Mon, 16 Feb 2026 18:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771267695; cv=none; b=HXoUjXVQfbHebv7plPN3p70yWcl95rfNmNod0rSxZKQaubB1yfNV0OWpQK5EaTrM5m1E6MRjrv5OeGwijuizbEsxmHmLbAE7YJ/26wQB+oBdSz5aFV5kie0QM5YTlPCRtM+xnNy6g173xXu2tHeo0VunyC8xZlEDSWRAX23ad00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771267695; c=relaxed/simple; bh=QbUr32o1qNknh8OKNJHyEYG9tcZZ7RE7ciOmZfVnlj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TEHGA5UavC6QjFg7j2prtYL+liTGHKtr9+/KdgJVLh1BAbj0FxVizd5lRu5G+xXS6KRmFOYppXI016TnRiz0pmupSGM/BP8yN85U1avwpeUNxXCpewrAB6toaHzzrb6epkC75t6bv8MvYnbc6xVdYWGS5vkhmquaarfnls8lCzE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=zetier.com; spf=pass smtp.mailfrom=zetier.com; dkim=pass (2048-bit key) header.d=zetier.com header.i=@zetier.com header.b=hQfrs/90; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=zetier.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zetier.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zetier.com header.i=@zetier.com header.b="hQfrs/90" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-8cb39f64348so297793085a.0 for ; Mon, 16 Feb 2026 10:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zetier.com; s=gm; t=1771267693; x=1771872493; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X54B7Vf+BK11FAXu0x08XDmOK83/BHoweBSyAzhyJlc=; b=hQfrs/90UW8ibIBRcYrMlwMObOKsn34uiLbXrMbF7br4gR6SVzmzKE5Z7s/yME5/fO s9SEReOxqHzkx14eN0YRvUOX10ALiAwdyqqTfccYlnMsKwhhQqC9ovzQbbtY0AbC2MtQ n2rY2XzVTeaHlsvARaLsPWWNdoZVJb2dFfbf1AhOUB+s9YoXbIo6/uAkqqk0VwjoKzS4 htSY4ZQHxtTO64YIE0rjoMUaPd7F82UzViE1EgTjxmf4QXj94HwgWeu5wVAV3Qyk/9Kf Kz86cARgf+Huo197EVm7BpJaheDkvUQNU1KV957q0cOIShM/WpwRLuB8+BorLFG6pBtH 2e5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771267693; x=1771872493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=X54B7Vf+BK11FAXu0x08XDmOK83/BHoweBSyAzhyJlc=; b=e06qedvFMXubzA9eygPW5UhlpHFqMlJ8dvrv2Ca+E5IJ6+VqRQRflM4682WMTIKvIe 170d7p3UNMUsftLOVwM2UUb7FpEsbFpFtrdccVKEMT7jdZHfzi/+jduOecxnRRhiFhKG TwVtVn8iIq5aRjdM1myAbRl6AU5k2plrz2waWUhj/LMpOazSMpkirK1VzmzWdME1zuJP +KJlms60pN54i3+tFwp19MSy1lD0oSPx5JV4abeYvpKebseJeJ+CFNnSV5i/Yt6NZetk ozWh1pbO4FNzvqeCgqpQOcmQfcv+oWQARFZ/BKbozUp2OrvJja2/hzsGqQnEq7Ck7U22 mSaQ== X-Forwarded-Encrypted: i=1; AJvYcCU9/G2+hetEaRBKFQq/1ArzJKrG+xb6U4gIdN58FanN8tuzgFUg2YC+/FrO4LEJQCWHodqQteFvCrPLnxg=@vger.kernel.org X-Gm-Message-State: AOJu0YzQzncFL7pGEYLYlc2akNQ0UmPQgnridR6Bi/sFEK6YEVL3HYr9 3a0NZdc9BtDKSDewYa/HBa0HxqqerFr8I/pRO4qF9agX4NJBrjzhdO+iPm1aeBg3ZXY= X-Gm-Gg: AZuq6aJh0uZ8i1C3tm6fc2zHMQPrsV4gpzZYN0koy6NyYmQKpUdQUd6FdvG8AlvCN4x dnmJ2HismuiYLX2GLGaTnj9CxY8/B2qxziueuPxPJGn+0gPgJ89EA/sOK4o7TLqY1CE1YqML5u9 1jPAHKlR0luoPluH0oeAbo3ux9xBIGWOBNOxKN5F2O5vnHHm794zCKf75TZlL3sK39w1HQeW0ob fg2pLep3v8m+KRoSnhILRukBTEpb0zu14sTPcOuhsvjax3Q/mp7ysFWZaveDQTY3cjqWwbsKi+K HsTCAAQTwPuTGPWqVw7iqSbxXPywnv3wHJfcl2Toqeq3EC0m3ETMd7OnLajx2ci+ag/BaVKu7M2 N9OjODwdGjdcB9eJz17Zx2RCJI3aIaPRuwrBRNw+sgydGjPsM8+WgzwjVew5rSVnEHwfn+o8X0X D8XVQYMzUuNtF5cEDLTiuHKDG3NeEtx4U/3D2JIhTq3Db2jNXo+yFQa9g+zkjwqyIPYGx4IJ3Ax vkB X-Received: by 2002:a05:620a:1a9c:b0:8ca:3c67:8923 with SMTP id af79cd13be357-8cb408d6a37mr1475950185a.53.1771267693386; Mon, 16 Feb 2026 10:48:13 -0800 (PST) Received: from warpstation.incus (243.69.21.34.bc.googleusercontent.com. [34.21.69.243]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cb3e89dc23sm1027650185a.20.2026.02.16.10.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 10:48:12 -0800 (PST) From: Ethan Ferguson To: luisbg@kernel.org, salah.triki@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ethan Ferguson Subject: [PATCH v2 1/2] befs: Add FS_IOC_GETFSLABEL ioctl Date: Mon, 16 Feb 2026 13:47:54 -0500 Message-ID: <20260216184755.48549-2-ethan.ferguson@zetier.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260216184755.48549-1-ethan.ferguson@zetier.com> References: <20260216184755.48549-1-ethan.ferguson@zetier.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the FS_IOC_GETFSLABEL ioctl to the befs filesystem. Signed-off-by: Ethan Ferguson --- fs/befs/befs.h | 1 + fs/befs/linuxvfs.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ fs/befs/super.c | 1 + 3 files changed, 49 insertions(+) diff --git a/fs/befs/befs.h b/fs/befs/befs.h index 7cd47245694d..e4e2e9f4e307 100644 --- a/fs/befs/befs.h +++ b/fs/befs/befs.h @@ -30,6 +30,7 @@ struct befs_mount_options { }; =20 struct befs_sb_info { + char name[B_OS_NAME_LENGTH]; u32 magic1; u32 block_size; u32 block_shift; diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index d7c5d9270387..942d247a6cae 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -25,6 +25,7 @@ #include #include #include +#include =20 #include "befs.h" #include "btree.h" @@ -64,6 +65,15 @@ static struct dentry *befs_fh_to_parent(struct super_blo= ck *sb, struct fid *fid, int fh_len, int fh_type); static struct dentry *befs_get_parent(struct dentry *child); static void befs_free_fc(struct fs_context *fc); +static int befs_ioctl_get_volume_label(struct super_block *sb, + char __user *arg); +static long befs_generic_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg); +#ifdef CONFIG_COMPAT +static long befs_generic_compat_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg); +#endif + =20 static const struct super_operations befs_sops =3D { .alloc_inode =3D befs_alloc_inode, /* allocate a new inode */ @@ -81,6 +91,10 @@ static const struct file_operations befs_dir_operations = =3D { .iterate_shared =3D befs_readdir, .llseek =3D generic_file_llseek, .setlease =3D generic_setlease, + .unlocked_ioctl =3D befs_generic_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl =3D befs_generic_compat_ioctl, +#endif }; =20 static const struct inode_operations befs_dir_inode_operations =3D { @@ -940,6 +954,39 @@ befs_statfs(struct dentry *dentry, struct kstatfs *buf) return 0; } =20 +static int befs_ioctl_get_volume_label(struct super_block *sb, char __user= *arg) +{ + struct befs_sb_info *sbi =3D BEFS_SB(sb); + + if (copy_to_user(arg, sbi->name, B_OS_NAME_LENGTH)) + return -EFAULT; + + return 0; +} + +static long befs_generic_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg) +{ + struct inode *inode =3D file_inode(filp); + char __user *user =3D (char __user *)arg; + + switch (cmd) { + case FS_IOC_GETFSLABEL: + return befs_ioctl_get_volume_label(inode->i_sb, user); + default: + return -ENOTTY; + } +} + +#ifdef CONFIG_COMPAT +static long befs_generic_compat_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg) + +{ + return befs_generic_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)); +} +#endif + static int befs_get_tree(struct fs_context *fc) { return get_tree_bdev(fc, befs_fill_super); diff --git a/fs/befs/super.c b/fs/befs/super.c index 7c50025c99d8..e6a13b497ac1 100644 --- a/fs/befs/super.c +++ b/fs/befs/super.c @@ -28,6 +28,7 @@ befs_load_sb(struct super_block *sb, befs_super_block *di= sk_sb) else if (disk_sb->fs_byte_order =3D=3D BEFS_BYTEORDER_NATIVE_BE) befs_sb->byte_order =3D BEFS_BYTESEX_BE; =20 + memcpy(befs_sb->name, disk_sb->name, B_OS_NAME_LENGTH); befs_sb->magic1 =3D fs32_to_cpu(sb, disk_sb->magic1); befs_sb->magic2 =3D fs32_to_cpu(sb, disk_sb->magic2); befs_sb->magic3 =3D fs32_to_cpu(sb, disk_sb->magic3); --=20 2.43.0