From nobody Thu Mar 5 08:15:09 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 D28372E7631 for ; Mon, 16 Feb 2026 18:41:06 +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=1771267268; cv=none; b=UzJvR+571ol1G7l8BtboNCHYWTpy7fuf0lHMjs02osKcgiKgpkF7ybJj86KMfbACwPLRuaKYDJQmtT6A/dotN/+qGsuSrI2xfQsrPeNZLrlVYUCgTPjYopv/4pWX4TFyNEGiQWfuio7UJZ3o+Yv8DxUyqNxzxBxWWK0ceVBtr9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771267268; c=relaxed/simple; bh=QbUr32o1qNknh8OKNJHyEYG9tcZZ7RE7ciOmZfVnlj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ggFg7cCtGV5w5OO34qlpf5Fo23OvTHH0wyWfusK7YjXbV39mTWoX+ELpon6C7u+ojEwLTVttwK/Vak7V56n4fGRh9Uufhy7qSWxUBR/Bjg8S72UApMD/YNg8x1XkQqOq11DFAYJtcJDgikHe0asAcFrRDnwoDvctgwkNbTsbVNU= 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=BHh2+VlU; 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="BHh2+VlU" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-8c7146b0854so366804685a.2 for ; Mon, 16 Feb 2026 10:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zetier.com; s=gm; t=1771267266; x=1771872066; 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=BHh2+VlU7LIj8WzOSttaOPQquED8qKmy+wrgVVjv/YAcGVXEsVsyDwQs8utltrHqB8 K8r0241xH1s819GdeWRR/tHzn1HNQcWKAdC7JOiY+CkQlL6bRw4Ah4oLOvo5jS3K0ARX BaoMQ7l/NBL2mDj15tnv7D2jTlL8LIP51ynIS0h37PmvwZven9gt/vpIHztm+uB1XbDv S2O3yGshcJwK23itDuaRyQaul0+iU44oJZ8QXqSyfFwzPzmUYsS8c7XRQbV3CUkPyEQk HFYDAifT4XNb69N/Hu5LnmEmc1z7UP1SmQXtLd3/7BHHELeJH9b3aWfizwS+/uIbnTaQ mcbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771267266; x=1771872066; 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=N0/D8BA2KQJH18FNXsGwGh0wKBejgeA29Bx0bj1ayCw/AE2SF3Bj1g7k2AyyNsjayK MZToQRPVk0UyFxGEbBOVDcALKZh9owGDJ6m4i/0o2ZBvlrIzmERJPa2TqLzvMmAVfhTM fE3dUqiGZDoBsDz32CtVrd6xT4agvutVP+moPozi/yJbpBB6KVZCBtVnE62Uhu4rSQiE GnMJRiX5W/y7kTMf84LXBiboEmEOqjuBx8e/pxxATcdtavXAt1fK4tcBslwQstpKmxVU 3KVvqwWjTgeUCy0oDGlXIX/OxZjCdmtF8PEAPHv4+eBeA2F+b55FV4O7OEiEyaj5gdhw 8KxQ== X-Forwarded-Encrypted: i=1; AJvYcCVFuIY8VZ9dz2q7lOfDlHfhqHZqV9CAzLgsKNhseRqT8WTk3E9JOhdd6YaOpv5QuQcNyUr1tJXk4xgIEPk=@vger.kernel.org X-Gm-Message-State: AOJu0YyBtmTAaGFnyKqIr6BQ6lRzBSMUNHN1p49b6Ss+fce2MkpD4S+k mAd7kEnEMOhlRsm8pRVqBGfgJCr4XbJ4UGVmHHrwbTJYMHIlrliOVMy/0gpaBHRbpDU= X-Gm-Gg: AZuq6aLHWLtNchkai29Mtj/mQ+qTLUKRh3Geoa9bW7e28wPUU/ULvKkucYLWuuXsOCi ObywIpfgca6kPL7odd3uCAQ+7ELOmppmrTHsUlAT+mWfPnvH3NRkhyp0SwNPk9v1SpIz5HcJz4o jS37QeIBCO+bQ9Ngik3jmx4SS7LijYDcYa9KSbcH/int8b7PumrpA1uSsl2EC3k2/5674ky+h12 BHyQW7eQhUEffzMQORgLedmOvoKla7W6fFbKipQ7Bx4T8m/sau7b+HMUOTKzUn0PVfOqZF2fBq/ +Jccuj+ZCUGvl3wMB5252IDW4E02pqWq8Fy7hfkYmQHmv0wQ+VUYBeCEaV3RWlxvY+oXyXi6vEO Y073itSzHTWP1+GCk+DbxMNcuZPtpqi2aevYvZJz+MknMoBTslVRGLJy44kmqE9pkSMta1xQO2k pgvyoV80MxHCT1hnmkbyqk2EYd6DUyL6uloHF9V4ZvWeHdx08Yp/8IMmy9basAOgXzl5OjmHUKO AnD X-Received: by 2002:a05:620a:298c:b0:8cb:4f63:dac9 with SMTP id af79cd13be357-8cb4f63e093mr908068885a.17.1771267265778; Mon, 16 Feb 2026 10:41:05 -0800 (PST) Received: from warpstation.incus (243.69.21.34.bc.googleusercontent.com. [34.21.69.243]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8971cca7299sm157766676d6.22.2026.02.16.10.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 10:41:05 -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 1/2] befs: Add FS_IOC_GETFSLABEL ioctl Date: Mon, 16 Feb 2026 13:38:58 -0500 Message-ID: <20260216183859.38269-2-ethan.ferguson@zetier.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260216183859.38269-1-ethan.ferguson@zetier.com> References: <20260216183859.38269-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