From nobody Thu Apr 2 22:12:11 2026 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 4FE7B2EAB61 for ; Thu, 12 Feb 2026 23:14:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770938079; cv=none; b=MRuZ4TEE6t57SkOnhNS0X5iI//Sb/+v3eIs1vhCSJ4h2g/bGrajunhcjwSHeUBk8iQEv2f+qY9Ph8aGxbd+yg6zHsHZrGhqgXHZQ2ksNfHrsW8uOU2wcv3ltG4SvMVbS1zazPabtr6OONNnyXkd24X3WMe34iHq6gUjNLLoRuQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770938079; c=relaxed/simple; bh=VujJSdmEoJTD6/CjhEXhw86+rrs42e4hcgzHdZkbE2s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZVsle0f8MgVwFUk2ANQlqqUICp2lzH5Xmk/77e3B5wUHgZubBWWKUztoS5pxZA4P8d0Q3gg1IKwMkTv5+R6CVgwF+8MftvNPIbsQ5x/C+X8U+RdiyTbLZITS0XjK/4AoRwdRv+N5+XI/iCkbWp/SR1NSOxrbl2kFbsY7/divcvo= 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=DJ849dH0; arc=none smtp.client-ip=209.85.222.181 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="DJ849dH0" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-8cb3b3e643dso27213085a.2 for ; Thu, 12 Feb 2026 15:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zetier.com; s=gm; t=1770938077; x=1771542877; 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=SYlTsqk5WbL68NN7FM9m06GUejc3cnUvw44ceTTX69A=; b=DJ849dH0xLOhq5hd4MSjo8wV9wObxVW5iPzCs5obHuEx7kvwwFnbVftqD7ayTTRQjK fqJN5WkAZOUWCm14eH8HBKPIfRhz/22RteGTLT1PKwFKc1QlHwb1Rkevyldm/gHmA3YM RZbupc2FZVI4Z7CWnIVgspN7PlV+6DtrhS49ws+AlO21SG40QaiQ5AHsEulOWHdkyEbX moUCN7NqmefOqofI+iboaPsS6Fq1zviv5g+8Kl7UQWf9KEh6vzJXMmqKIPrSOrnvWa+X FHZ4CHsI9udtj2EiBBW9FhxVxwneH74Q7F6+7dYkWMiqi5IoiiRRVG/uu3VwVCOLmH49 d8mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770938077; x=1771542877; 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=SYlTsqk5WbL68NN7FM9m06GUejc3cnUvw44ceTTX69A=; b=H6c3UiHQS0t4sp6sr7g5fEjm1GiNDrUYi5yfskMop2Li8o128aldggUsQH3UUEAk0J nauQt621fIpXMNdtjt0g1CL1RxV5UyKGzXkV+M53dv2dx4FaZ50jzC5u1bgtsJNkyk1S G2V08upb8Dsowoc589w81DYA7Mil2Cc6rAy5rY5DjwqUPtXwp7r+iluSk4WH/3Jdy+vd tYWc7+qU81aIHOm4US5UZDGTkQPGX6FWoJ4akHVW6Dj5DXhorp1Crq46WEzwyOfuac0A 8E1z8ugGGDYr+PTu2xGclW3i0sLsWjlLRANsfvyc6J23O9x+PO/iXD/U0dihAtviSQqH k/Ig== X-Forwarded-Encrypted: i=1; AJvYcCXsOByTUJyn9ifM7EsEEvrSsZX8IZ+xdWTtL7SiTRP+J93YihAxwSSd5TTFdwb8d6dgdDVdil7ydsqp8Tw=@vger.kernel.org X-Gm-Message-State: AOJu0YwjaiwfZrSKjGSy4L0FPV39SLmkcOp3HppwCEI2QFzLFyaYq/iS o9xRWYEm+DWaeBB5aFI3Ww9nshuQ75tTnCn2pIVQDqHYN8REfRsbWEXODvh2O3jK1Xw= X-Gm-Gg: AZuq6aIUAPy+W7Q2Sp/STgARpX5yJQ9sgITTHHCf9vOWC9pk0Cy6bSvAHk+xPlkcdpq igdsJgkoz+hR924JO7+8uBuzATMgpC19ZA5xUgrWZXxzMy4Zhwp3JasHoLlzbs/d2O3PGrJuprp A7ExnMenid2wd+pF7OlG/MEqOfLcfP09pm1V/KnaSgno7D0nTMma6O9ioWmq9EU+EWb8w8ySPlr /Rfh5PqalNbQhHEnunUr/QXLb4b7cC9oSXR/bRuKA1uYAi20OlYPkg/NjKTJom18uCcLBfFnVHF qGWh3CiNFMEgjKi52wN5gZ9rwjsExLODIeoAYwfRyKa5qqEGCMbc283rBlNcUkLd6KBNPgn83Zc KLHXvIMrOcI4zXgPbPbq/mdiMpUFVzMF9OpVjKZ/1J5M7eyiONONw6dUAnFUrvx2/P+Jc0LcUtV yBvALslcGljN3QyGcBcVGecIngwz/XzWY7Xq42OOsNEZBJFpsfasMKb3ZwIBEVWW9yC6NxXAyMY 5w= X-Received: by 2002:a05:620a:450f:b0:8c5:1fd2:e9ef with SMTP id af79cd13be357-8cb408693cfmr75424285a.28.1770938077327; Thu, 12 Feb 2026 15:14:37 -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-8cb2b1c8505sm441165385a.25.2026.02.12.15.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 15:14:36 -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: Thu, 12 Feb 2026 18:13:38 -0500 Message-ID: <20260212231339.644714-2-ethan.ferguson@zetier.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260212231339.644714-1-ethan.ferguson@zetier.com> References: <20260212231339.644714-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 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ fs/befs/super.c | 1 + 3 files changed, 48 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..4850295e5fe0 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -64,6 +64,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 +90,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 +953,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