From patchwork Mon Feb 5 20:05:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1164153dyb; Mon, 5 Feb 2024 13:51:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZLw5zRD+7BSjux01XsMoA2aE9D6pdbQhInMdUZ4OuALvPzX2WD0ZXbuN3Rdw13sgG0itW X-Received: by 2002:a05:6870:434f:b0:218:edd0:439b with SMTP id x15-20020a056870434f00b00218edd0439bmr578611oah.28.1707169919728; Mon, 05 Feb 2024 13:51:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169919; cv=pass; d=google.com; s=arc-20160816; b=MORwmy0zdQMvQWnXDLjQ+3AcfaPWAB+y3Voo4+mPcafIdE1c6sEwNPZlLhwZZInvBf d6GIulSWYqaK/N8Rn3ijjxLhzktPfU+n4rQiAi0InTr/3+XZ/vescW9ieqGnsA39Vzg2 2+4Ql4Eqd/ix3xx2QKtxAdN3sqMJudzqQeVQC7Xueqar1IhbZM2CdGpniqlJ5CtOEtgQ cz6+UySHEwjqhmzgNkSn7lcLykwQlHXYB5S1vTXjO6HBGL/fTB6boxZDM6RHXIOK6s9u VsESY/T66Gnv0bGHA5Zut/uQMZwUV/qYQI7xFx/9mHwoX6By6ay30bIONEBs0G5Zj63j WrQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mxk7XRZEL0snESkDWwhfb1zBoSWiW2T8Lz3o6KIMn8M=; fh=W07hrQAf2guqB9XBoX1ppxeXxsPUVG9Srcuzj9BjqiE=; b=T9pkD/HFdkqWMKh153le1bB5G1vwNQ5FGhq+tdpFU9b8aGEoIFmpwb8pflHC6z1Gts 8d8UW4tC7dAaxbc7EEV+Y7VT2U2y1w+ZTl3ghWE2F/8FkBtWfndRh+xm2X7z350yGiNE zTvBVW6WAnSkvXXd2VdkU3B3Lnd5ml10Of1GQ9dhpgH0OzRblhMSfNWimIFm+4K2N16k qBKpyqMQW+BXN+dkh2bB/U40vdUQckfRd399oGKJhj4pBQEWrnHmJ5r/6a8+04faPAgr n7dAj8R0OONlNO0REqDSkbcc71l+1IzvbHjpt1hF9YtyjfaZG98Yj60iGhAXb9XmbTEf pn4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="uob/dDzx"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53886-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCWi4iqsW8/79ZNGOXHt+utLvTZd0wA0cVt0QXBq2FBWSifsbsXV4gerHJdxMm2TkPzLaBxauBtb8p0mZHoVTfJ3iDlAhg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m185-20020a633fc2000000b005ce0205d0cfsi494749pga.306.2024.02.05.13.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53886-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="uob/dDzx"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53886-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A79C4289B00 for ; Mon, 5 Feb 2024 21:39:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08BD212BF01; Mon, 5 Feb 2024 20:06:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uob/dDzx" Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9311A12A16C; Mon, 5 Feb 2024 20:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163568; cv=none; b=WG5zig3iEu5YanU0Dr/q2NkGiT1faHMkJK8JkZZc6Erb2uoo2lvmCbrNHKzV4SoJbHhvzdEqCPRpfcD/nuh3ljxmfEAb+07G8dflJk7s+OW1pNCr/EyuN2hD0OkSMrME9XP/vtFSndkCOkJlsU1+SQ1gWM+uBaOtbvy+GlMxWVU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163568; c=relaxed/simple; bh=sT0YhdGMz+E9RZmaN5yZSWMd1g+aYCrhSj7fqmLAo7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iojZrQAi08dpdEkl+Iau1yW5TSwjo7Pp1GOhe//l2BFPdMLj4NrYQE7XXZ7sEfaHQqvLOzp1n8JybIeAmeqFpTPZyBwIIY3AeoxQBUY4wUfm8IjYYFOHqYppIfq2Y+KnG2Xj76VtCVyQSzrfhzi+EpE2P7xtYOjR0a9qSFOWvMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uob/dDzx; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mxk7XRZEL0snESkDWwhfb1zBoSWiW2T8Lz3o6KIMn8M=; b=uob/dDzxQcIREDsMEM9g/iWBuz0YPHzPTzop+cY2f31oBhFBJpCrXqtQ7KCYfdmuorHek/ 3BdFAyeJ8xmW3cVWSpJ8jwVBKqrGw114zEAqI1kXcx6EbAAY7oyS1MVSqTQRGZeWGiMh3T 67MIwynAHlE/7CcJzvVvZxLHj5EuROc= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 1/6] fs: super_block->s_uuid_len Date: Mon, 5 Feb 2024 15:05:12 -0500 Message-ID: <20240205200529.546646-2-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790097405703080062 X-GMAIL-MSGID: 1790097405703080062 Some weird old filesytems have UUID-like things that we wish to expose as UUIDs, but are smaller; add a length field so that the new FS_IOC_(GET|SET)UUID ioctls can handle them in generic code. Signed-off-by: Kent Overstreet --- fs/super.c | 1 + include/linux/fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/super.c b/fs/super.c index d35e85295489..ed688d2a58a7 100644 --- a/fs/super.c +++ b/fs/super.c @@ -375,6 +375,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, s->s_time_gran = 1000000000; s->s_time_min = TIME64_MIN; s->s_time_max = TIME64_MAX; + s->s_uuid_len = sizeof(s->s_uuid); s->s_shrink = shrinker_alloc(SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE, "sb-%s", type->name); diff --git a/include/linux/fs.h b/include/linux/fs.h index ed5966a70495..ff41ea6c3a9c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1257,6 +1257,7 @@ struct super_block { char s_id[32]; /* Informational name */ uuid_t s_uuid; /* UUID */ + u8 s_uuid_len; /* Default 16, possibly smaller for weird filesystems */ unsigned int s_max_links; From patchwork Mon Feb 5 20:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1159952dyb; Mon, 5 Feb 2024 13:40:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfm5+XRjTSYOUsBy7sm+NH5UXf3w9Mb1o8J2pywdHBKFBfZhMxMHsYUikwKEVvaXT4gniX X-Received: by 2002:a05:6214:d4e:b0:68c:4167:fc5f with SMTP id 14-20020a0562140d4e00b0068c4167fc5fmr847514qvr.52.1707169218117; Mon, 05 Feb 2024 13:40:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169218; cv=pass; d=google.com; s=arc-20160816; b=0RjhK2TJ4tWsYA2PuOJLuQuMHmImRqpU3YLynwdBHci+R3NXPaqf1RP/3Et4gfHTx2 O85Wah69jRM6I4yIiT4balQ601FtJs/epFofXc1kluqs+uCDcn/5gXHMJtx5Casu71JE 81Q6+dzEoUozq6IcKI+4/fu5efENqxtW9AuWS2mtGwmvdV8yFE3JBamfY53ay2BFgo21 yzNuPzwNC1vOT60CgNfApmNVw+zsLMzIvvFwrIYezZp9W5y0APyigGU+EM4tk0EfpqJ3 82eC8SImQXLujfd1h/YAXizikmpgZCf2e/ziUjmx5OEbji2DGCDGxhjssG7xRVLrNdLf /ABA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MqXRwSUVpxeinEtP3l48LwjODcmqmNTThZB6l3iXHHM=; fh=meCDMtVM0JBA4uuxJiSBzfIYoJ7ITqhr/3SvPTSWrQ0=; b=MCps5pnw9dJQl7NzKEtsbOoQHTiZ3yZ2oa/0IukTo6sIyOLfgHl4JvlWmxjJAzbOIH 3H7LpNhu04PGOOYUwVQIqFh20SJE9K94VEaAFoTz/16pHYjftaynuc5Z28pnMXxArnsA 847t0CIxn/P43Um2stZaScymfJ7+ZgKoznfijHvxNdviVSQ63AUyTzWXKIF3ycoDCMo6 wVUICSY9PaKd/xV7M/lgai2FLfc5iD3HB89/CciOKYRQIXvSl/Ye5veAWr3fArwYEgay Iz8wNtJQ69wCCc/l9flM5Z7/9Y3kr+YsP8EGyGx6EAuyw/dM6LjrC/iy97OQU3aib1gh QdNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Wcr8U8fQ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53888-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53888-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCVr/jlyYTSeh/CZcEPY/adXFUCosIsIem/dZzYIFmrmhZIEvHhF1wtSNhErSvNGcLxzdB3KLioC+A+1qhM6d7tzfSHdww== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e4-20020ad44184000000b0068c405115dbsi890832qvp.169.2024.02.05.13.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:40:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53888-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Wcr8U8fQ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53888-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53888-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4E00E1C21740 for ; Mon, 5 Feb 2024 21:40:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EE5412D143; Mon, 5 Feb 2024 20:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Wcr8U8fQ" Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B234212A173 for ; Mon, 5 Feb 2024 20:06:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163570; cv=none; b=M+BWx3w0pbHh8os6OuJzgVQK6ddSPA/upZS+PFTHig6io3FXwiXHHJmPXvq5FN8nqN7AyuhpWxJ+i8j9IODtt6+8VtAW/Ke8sGB8xhr4ENo2VTu4KjrKKFiBo3bixQr98Mv36rqMDOMRqCLgjzQFXj0SKzoMT85kk61izmLMGdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163570; c=relaxed/simple; bh=hPLAUyLLwUKEPrP5CZCmbgyMU8k8zrKbJNl29jrSSdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQ5JEngN7Vqr33HRs6puw0IAMo7UzXSJWRt7YzFpQRAdmFHwfNgUrhglmWu8OwkC2EetbejiR8rojq/+TqgjLi9j2L88TKYnQRhoNdnKP0bxLSmtz5lZoQjdU6XybjSEiuhIHo4gjxu2y01sT1sY6LaouqHfD9tUUM092/QHG2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Wcr8U8fQ; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MqXRwSUVpxeinEtP3l48LwjODcmqmNTThZB6l3iXHHM=; b=Wcr8U8fQCqYiiXre7rQymRda8iHSMIpNPM3+OFYG4WDeLA1Xpd1jwEnMK723HJDBKRO5l0 g0554M9yp0a1oAe+iJ5UMU98kzaBHHllX6DgrX82A0VDgaLHrEBCg1qxgYvy629vbxAx40 HOhKsQ9HMoJfioY7Yt4DCYRG9xNNBNs= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet , Christian Brauner , Jan Kara , Dave Chinner , "Darrick J. Wong" , Theodore Ts'o , linux-fsdevel@vger.kernel.or Subject: [PATCH 2/6] fs: FS_IOC_GETUUID Date: Mon, 5 Feb 2024 15:05:13 -0500 Message-ID: <20240205200529.546646-3-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790096670290497475 X-GMAIL-MSGID: 1790096670290497475 Add a new generic ioctls for querying the filesystem UUID. These are lifted versions of the ext4 ioctls, with one change: we're not using a flexible array member, because UUIDs will never be more than 16 bytes. This patch adds a generic implementation of FS_IOC_GETFSUUID, which reads from super_block->s_uuid; FS_IOC_SETFSUUID is left for individual filesystems to implement. Signed-off-by: Kent Overstreet Cc: Christian Brauner Cc: Jan Kara Cc: Dave Chinner Cc: "Darrick J. Wong" Cc: Theodore Ts'o Cc: linux-fsdevel@vger.kernel.or Signed-off-by: Kent Overstreet --- fs/ioctl.c | 16 ++++++++++++++++ include/uapi/linux/fs.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/fs/ioctl.c b/fs/ioctl.c index 76cf22ac97d7..858801060408 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -763,6 +763,19 @@ static int ioctl_fssetxattr(struct file *file, void __user *argp) return err; } +static int ioctl_getfsuuid(struct file *file, void __user *argp) +{ + struct super_block *sb = file_inode(file)->i_sb; + + if (WARN_ON(sb->s_uuid_len > sizeof(sb->s_uuid))) + sb->s_uuid_len = sizeof(sb->s_uuid); + + struct fsuuid2 u = { .fsu_len = sb->s_uuid_len, }; + memcpy(&u.fsu_uuid[0], &sb->s_uuid, sb->s_uuid_len); + + return copy_to_user(argp, &u, sizeof(u)) ? -EFAULT : 0; +} + /* * do_vfs_ioctl() is not for drivers and not intended to be EXPORT_SYMBOL()'d. * It's just a simple helper for sys_ioctl and compat_sys_ioctl. @@ -845,6 +858,9 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, case FS_IOC_FSSETXATTR: return ioctl_fssetxattr(filp, argp); + case FS_IOC_GETFSUUID: + return ioctl_getfsuuid(filp, argp); + default: if (S_ISREG(inode->i_mode)) return file_ioctl(filp, cmd, argp); diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 48ad69f7722e..0389fea87db5 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -64,6 +64,20 @@ struct fstrim_range { __u64 minlen; }; +/* + * We include a length field because some filesystems (vfat) have an identifier + * that we do want to expose as a UUID, but doesn't have the standard length. + * + * We use a fixed size buffer beacuse this interface will, by fiat, never + * support "UUIDs" longer than 16 bytes; we don't want to force all downstream + * users to have to deal with that. + */ +struct fsuuid2 { + __u32 fsu_len; + __u32 fsu_flags; + __u8 fsu_uuid[16]; +}; + /* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */ #define FILE_DEDUPE_RANGE_SAME 0 #define FILE_DEDUPE_RANGE_DIFFERS 1 @@ -215,6 +229,8 @@ struct fsxattr { #define FS_IOC_FSSETXATTR _IOW('X', 32, struct fsxattr) #define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX]) #define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX]) +#define FS_IOC_GETFSUUID _IOR(0x94, 51, struct fsuuid2) +#define FS_IOC_SETFSUUID _IOW(0x94, 52, struct fsuuid2) /* * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) From patchwork Mon Feb 5 20:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1159946dyb; Mon, 5 Feb 2024 13:40:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiRglz/7jN2BtKYi90MCU8tu+FIwV16HdfBn0ZsdOOetc9laVaV0qfJW7wL66tb05qoB64 X-Received: by 2002:ac2:5b08:0:b0:50e:7c70:f8da with SMTP id v8-20020ac25b08000000b0050e7c70f8damr559543lfn.16.1707169217658; Mon, 05 Feb 2024 13:40:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169217; cv=pass; d=google.com; s=arc-20160816; b=MvRXX4JglPhDrSxFTv1IvHv8m3Ww7pNZt/Rt+3yMcsSp94VUCxHffTxZ3WqwQpTSym UP25FVyJX9rPoqyNRyrPjQsoWzBcvkNeQV5MtRuLHwAqT4aHF4TyOCqDF7P7ZVq1rAbT lEPCA62WP/i3wwZ0Yyj/Lj8ZeVDrADMStaRm5V1mxwFqCEagEUUwo+Ba20izQ2/OtIQh Viex2dIiEPP0mfdWgTOzg8r2r1qXQcJUhWLb+IHSob8q2jlUkTVb3zGw0gphIaCMXCY0 k3sGcQ7q84skZWXT4L8RquyjOvBgo0krEspkw+Dd6LjxVKf6q17YZj5gwIFsJXo0F1Nm Fz0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+Y3gjAfbNTQAYItYsU5COE7+yozdE8QNyrcmsyi3W+A=; fh=5Q5U7H9vlJ8CcYb2txp7aIdekD8+Clm681tGSuS4Cz4=; b=M/bzv7MLQSJtvN1yq5KJ8q2Ilwuu60hVcE23wb6G2zEMwkp5aKSRGmWBXsSS0ATmhu Nx2vMqkLaqq4oeUCoBJtf3yUoH6V7yHkPXFY5WRbWSFjpz8RoXErSsg79xxYsWSS7SHN T5IQX1D28ZQzyRdgthhawuSnD8iLVwF5dLx8aGzeZJcYDihqZrHViG5t4M3gno6n/dDk VJsRney5VVEU3QKigbJYRHUI9P3qYp+6NepF3Wh3FA9ibEDCMQBPs6UTIcWN2B+0qF33 +hdPII8ODNKbuNPxjAxZ0ooZL745IysIztn5k+db9mWCmuk78N+FF2cyruAL1r7/Pcnx YItw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dg8R9kdj; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53889-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53889-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCWBM0N474zLt7bAiEJiBg9xTnEej4nF81h0rxphD43wBAxlkaiURsbETuTdfsPMfZtz7mkOJLu2xwGL2s0DAvuGQbykxg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q20-20020a170906361400b00a376d1b700csi254875ejb.736.2024.02.05.13.40.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:40:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53889-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dg8R9kdj; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53889-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53889-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 359DE1F2B1F0 for ; Mon, 5 Feb 2024 21:40:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9034412D14B; Mon, 5 Feb 2024 20:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Dg8R9kdj" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66FC012AAEF for ; Mon, 5 Feb 2024 20:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163571; cv=none; b=vBgGmoRHPUM4uUTvCQPsktRltC/eGG0PGqAcfgqITID7rRNbHHST96t3kRFPNaHFO+Og1qafFevV7EgzYvA0eQuAipQlDbJSkrZNswJTJU3I/WDkdRQ5JrqJ+Cm1pJJE+7HJmDupOJUYV3PKfIhwT8yUKz0Vcdvw8Blnt1VskMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163571; c=relaxed/simple; bh=e2lTROAYcoM/HDLzlNIvyaAd2xWkASoCHOPzvyTKoeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gH92YWGnOqRXVcTNiyS/XUYsDPYqKdYfcJHUqhhDuwJ9VmUhZXmxHRzkc7DTVza5CAFwbqpF8++4TK6eO5TmyP/jyhAtYe11i3zypad47wKwyObLlsfGcj2C/Lv4q3R/JEr8jp08rIcJXJHAYo1mN2BXm9OdxJawrigjIFdv63c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Dg8R9kdj; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Y3gjAfbNTQAYItYsU5COE7+yozdE8QNyrcmsyi3W+A=; b=Dg8R9kdj58O0ZqQd8Z7H3MJ/Xo+17XcsMUPoyC294HD/6wNiULMRl/SvP5MfWcctiuI5Io t6CsU8lFKiS3p/H+xykTaZ3BnRI4WQGh1bEXwdtcL+5YOwxMPZjB8OrKC4sytClnNQmBdQ OH6F7iJCR/fZItMA4ZecGTa8HqOC7p4= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 3/6] fat: Hook up sb->s_uuid Date: Mon, 5 Feb 2024 15:05:14 -0500 Message-ID: <20240205200529.546646-4-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790096669745428013 X-GMAIL-MSGID: 1790096669745428013 Now that we have a standard ioctl for querying the filesystem UUID, initialize sb->s_uuid so that it works. Signed-off-by: Kent Overstreet --- fs/fat/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 1fac3dabf130..a3d3478442d1 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1762,6 +1762,10 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, else /* fat 16 or 12 */ sbi->vol_id = bpb.fat16_vol_id; + __le32 vol_id_le = cpu_to_le32(sbi->vol_id); + memcpy(&sb->s_uuid, &vol_id_le, sizeof(vol_id_le)); + sb->s_uuid_len = sizeof(vol_id_le); + sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry); sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; From patchwork Mon Feb 5 20:05:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1163931dyb; Mon, 5 Feb 2024 13:51:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbaYVjFLWCkLWh/a9qnBnpn9UzY+rrdLiTLQ1SkqUJoIZt7mi1cOE1eRNDjmlZXfKUP13w X-Received: by 2002:a17:903:41cf:b0:1d9:a890:e72f with SMTP id u15-20020a17090341cf00b001d9a890e72fmr1112897ple.50.1707169883796; Mon, 05 Feb 2024 13:51:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169883; cv=pass; d=google.com; s=arc-20160816; b=1JAJNSlJ+R5m6W0+nsWdavS+RRtbCt5Gk0DbThX4KzVHjs8xZqu9eFxtxfYkK2y2Oj aq0N2xteXbuBOezOgBcIlPwuxMlpNZIPcteRpZx0ehQFWehypqw8dQFnI9fQVfaOyolC HFTkBcM4g0hmdVjHE5LDjVIvtyxltftZ6+KtHw052NSY9mX/APheX4yx3Qsxod4JhgXO uyx9lH3pHYHdjkSu15mbYJ6cejs6HhGD0n4fYdm3fZTiwTGK8xpIwjH7/mhGAvbSItt3 816z9XPTf4n0CltI2q0BtyiKw4b5VjcaWDMPKieAm3wJmfEapak33q3fh89UxPbkmZ1L zwcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bL8wabdGusxxHP4HD7jQgm1B3xq2dag3vBv1kp/RjKg=; fh=rJgmugYtAQZzcYc/GXHq80jI8rMQvD++fxHHnMVstSg=; b=p3g4uhoFzm4dHRo1APpe8SZ50ae7ukEWk2nN1eeaDBQhilKMJo9oZkRh+kAnDQ2GE1 Hb59Swo1FCARkc4P9WFJFnMoEAWo/daVGZZgLIGprY+nQ2kbT7TaKERcd2LdyRXjWOTI uAgMNIvaMLr8TK6t1h5ibOh82Lh1q5M4HSPW+5H/PotasBZdZvYiCXP80T3Wvdsl6J4M Aq5U6h4wQEh0oAoRNAG0ig4vV9zCOgrvur5tJVLR9Ofys1cpfLG06Z1aJjB1vC4Muiqy g8uJ/CzqcqkwPnOzD+cqwNSwmOV01+2HCmEKyrcqqRT91um9PRha5DqOTT49khPlD4BC O4UA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gRu95KeB; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53891-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53891-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCXR4sb/HrP4M9bTEE8liHA5rDLDsoEynz4oWc2NUCVPgQPcuy5Lm8vjC9TVTwQ9AelIttg8BrNspDaPunm/NV+rSstOcA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ei9-20020a17090ae54900b00296a3c5fb15si1904879pjb.34.2024.02.05.13.51.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:51:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53891-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gRu95KeB; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53891-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53891-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B4DF3287386 for ; Mon, 5 Feb 2024 21:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A23B12DDBA; Mon, 5 Feb 2024 20:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gRu95KeB" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0833412BEB9 for ; Mon, 5 Feb 2024 20:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163574; cv=none; b=A1WKM5hKmHCQh96ohwGbOeCQ6fzi1GF6AltCHEhR94EB+BGhzutpJUk6qhdWxNwg2Gkf3Q/uMV3uviCE89DuN6q1PTaUBE9pqIj0HPOW7wHd+6YH5RNCE4v6lR6dDQJvJ+o5r4pOOUyqft27+6gu0uUuwqO1M5AXV/cfIBHGQmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163574; c=relaxed/simple; bh=OdB2sC0IAQE2qn+uq4dM6SEPk8ivyay4tbCp7RxmvJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PTcnhIJBtYEvzoZQG/L+H3BXQY022tp2pY0dN7qhr6/xqeSm18Pp0aI09wwQw0l6ewzc8zydA3Mv6rV/JsnkvXL3qdtD+fRSLA5PseTgATWHIZSQeOZo2EBiqFmzcWDYQXjf0kzVhmSXc1KdWIKI/kHoGxDRngfge5anJfiPWSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gRu95KeB; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bL8wabdGusxxHP4HD7jQgm1B3xq2dag3vBv1kp/RjKg=; b=gRu95KeBmO7sGiIbVqCYHB62tHtBwScHj+QOvvEH7lwcGJhQRU4Id4sAq77nVqqAdbHcvq WLxA7xaJjngusplfaeucaDsaWwFjXqTUcYoVvkGuf88BCvqpXeJIIR+yzYkfGRbJ+OIIvr LO2rJ4oDpy+0FUucX1pT3epb4UOcd1k= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet , Christian Brauner , Jan Kara , Dave Chinner , "Darrick J. Wong" , Theodore Ts'o , Josef Bacik Subject: [PATCH 4/6] fs: FS_IOC_GETSYSFSNAME Date: Mon, 5 Feb 2024 15:05:15 -0500 Message-ID: <20240205200529.546646-5-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790097368007097421 X-GMAIL-MSGID: 1790097368007097421 Add a new ioctl for getting the sysfs name of a filesystem - the path under /sys/fs. This is going to let us standardize exporting data from sysfs across filesystems, e.g. time stats. The returned path will always be of the form "$FSTYP/$SYSFS_IDENTIFIER", where the sysfs identifier may be a UUID (for bcachefs) or a device name (xfs). Signed-off-by: Kent Overstreet Cc: Christian Brauner Cc: Jan Kara Cc: Dave Chinner Cc: "Darrick J. Wong" Cc: Theodore Ts'o Cc: Josef Bacik --- fs/ioctl.c | 17 +++++++++++++++++ include/linux/fs.h | 1 + include/uapi/linux/fs.h | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/fs/ioctl.c b/fs/ioctl.c index 858801060408..cb3690811d3d 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -776,6 +776,20 @@ static int ioctl_getfsuuid(struct file *file, void __user *argp) return copy_to_user(argp, &u, sizeof(u)) ? -EFAULT : 0; } +static int ioctl_getfssysfsname(struct file *file, void __user *argp) +{ + struct super_block *sb = file_inode(file)->i_sb; + + if (!strlen(sb->s_sysfs_name)) + return -ENOIOCTLCMD; + + struct fssysfsname u = {}; + + snprintf(u.name, sizeof(u.name), "%s/%s", sb->s_type->name, sb->s_sysfs_name); + + return copy_to_user(argp, &u, sizeof(u)) ? -EFAULT : 0; +} + /* * do_vfs_ioctl() is not for drivers and not intended to be EXPORT_SYMBOL()'d. * It's just a simple helper for sys_ioctl and compat_sys_ioctl. @@ -861,6 +875,9 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, case FS_IOC_GETFSUUID: return ioctl_getfsuuid(filp, argp); + case FS_IOC_GETFSSYSFSNAME: + return ioctl_getfssysfsname(filp, argp); + default: if (S_ISREG(inode->i_mode)) return file_ioctl(filp, cmd, argp); diff --git a/include/linux/fs.h b/include/linux/fs.h index ff41ea6c3a9c..7f23f593f17c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1258,6 +1258,7 @@ struct super_block { char s_id[32]; /* Informational name */ uuid_t s_uuid; /* UUID */ u8 s_uuid_len; /* Default 16, possibly smaller for weird filesystems */ + char s_sysfs_name[UUID_STRING_LEN + 1]; unsigned int s_max_links; diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 0389fea87db5..6dd14a453277 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -78,6 +78,10 @@ struct fsuuid2 { __u8 fsu_uuid[16]; }; +struct fssysfsname { + __u8 name[64]; +}; + /* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */ #define FILE_DEDUPE_RANGE_SAME 0 #define FILE_DEDUPE_RANGE_DIFFERS 1 @@ -231,6 +235,7 @@ struct fsxattr { #define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX]) #define FS_IOC_GETFSUUID _IOR(0x94, 51, struct fsuuid2) #define FS_IOC_SETFSUUID _IOW(0x94, 52, struct fsuuid2) +#define FS_IOC_GETFSSYSFSNAME _IOR(0x94, 53, struct fssysfsname) /* * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) From patchwork Mon Feb 5 20:05:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1160237dyb; Mon, 5 Feb 2024 13:41:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5RpOmNZ8+IfjhqY2XExUHbfhS1Sm5pa3YqP7MYjMTOcFyGnWuLQVzRcMY4GR6/9gmAR+n X-Received: by 2002:a17:907:7704:b0:a35:9311:6c9b with SMTP id kw4-20020a170907770400b00a3593116c9bmr369618ejc.40.1707169262776; Mon, 05 Feb 2024 13:41:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169262; cv=pass; d=google.com; s=arc-20160816; b=BCoeh4iZ5eqc1HP8ytzx0ZRVfmZVbhpssZ2FbqnXggRYDldW96jRpxhPNkgNJkvHU2 qu+pzg5nElewLmrPdu/V7Y5phkv0Ha81d+kWXeLVJIiM8fN2JDyjCAGQu8rvRK6xv8Dh HA572+R8mBJd9VZn0k3vQxfJwGHsAePn780zi5ru/k5ihwVlsZzyhDDZJLyGbatyurmC DsjeGUm9/ZO31ujzEFdjUdcd0VDn5u8vp4JsgR+4hgT4UVDGt4vYMMJYeIklnxP/FQr1 4npd+bvVVv7CNHrXIx8kacBMX5airaHfKMJIRDdk5/GqFELDSrfQYJHZxaGRUPxnxKH8 v9Rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LjLLoTR+ir1vHIuy3hXsUuRK7GJSfSeb1z1mFbcs/pM=; fh=QyCYBFXcB2pokAiYhnSjI73l6XBAnGnY9XA3iXwJlZU=; b=NefxQwjGRv5RFfmKg3G6KagloH7UsDNOiUFdu66Qgz9zryWCfd3xVOD3nLQ0EU74Gj p+hOpTWejMY7+o1+06apkMM1W4NyCN7x6oaHxrbsfCtI0vbqaGsewwj4zE98014PL/Db 32433DHG8S4idG4//lT90WPBg1m6ZDsRZRqo4ZAxvuy6YnoGC5hrsqOOHPUHqKPk8jrg qiBmXGObYRWz3DJpbqLsgvPyrPEjJqwDFBrpryILOQGhePUlc1gZTAilEY3PwiM2lywD Zj7MDnUSMq1HWAv78OgZO7xkbO/Y0+VIHJbL6AvfgF+/zgI37vyVbS3S/SJKQwUUTx47 3gsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xTYaLnhM; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53890-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53890-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCUKTc7kzMG31exYL7kIlj1dPvThVZ9/k8IpSLN2TEPyDNmpVZym9lMd93do47SBl+n431DFSJ43MDtm3BLkx6SvnQvrXw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k18-20020a1709061c1200b00a37eef53f41si265065ejg.125.2024.02.05.13.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:41:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53890-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xTYaLnhM; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53890-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53890-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5F0221F2B0FE for ; Mon, 5 Feb 2024 21:41:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AFDC12D77E; Mon, 5 Feb 2024 20:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xTYaLnhM" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C60A712BEA4; Mon, 5 Feb 2024 20:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163573; cv=none; b=OUpw88ANqNA7J4ZE3MTkS+StKRgudqL3kwSOjr7aYzv2FufBVMRAP0XYNfGa44hC1HTAsk6fpzR64SaW3c5ilKDDwA+ngdHeTrpuztsHZkYA7uvr+wB2xfLEp8nRe6S/leoTO2iS5bSJh/pQJEm0U0ZnGOcMDj8DA10qagMiwVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163573; c=relaxed/simple; bh=SpXRXuGnMtRwA2NcE51fX/znF3QwnMp2SZRjBoEEXhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cTu5eequhJh5KGz0Xsz9s06HUDMEej03xJDPlFHSQo3M+eKceBoWH2A0DiPetgm/3+9+ty5tJKYRqMmkOGk13onFxDsTp90b/3nJWlxOid5l/ipTGuerDJ47vc5swu9Y6N9AmCQRLsGtjusKjoL1L+5CP6c/fPpO0MWxZWau4sM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xTYaLnhM; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LjLLoTR+ir1vHIuy3hXsUuRK7GJSfSeb1z1mFbcs/pM=; b=xTYaLnhM62iIw9h5mlJHwn37PFD+85rp5V2iVlzDFkUm/hiGWhkq5JrHRt13ZXTLbc5Qqz cTHbzZadurpRL3NbkqdBkVzPCdxApb/tvOrNOsqUEmQ1SOFbq/dPloj4T6KJeTph2qziC+ Z0L+ka/B3oCSICX1qvb2qZpVQDiV1Zw= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 5/6] xfs: add support for FS_IOC_GETSYSFSNAME Date: Mon, 5 Feb 2024 15:05:16 -0500 Message-ID: <20240205200529.546646-6-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790096717086028564 X-GMAIL-MSGID: 1790096717086028564 Signed-off-by: Kent Overstreet --- fs/xfs/xfs_mount.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index aabb25dc3efa..6d16203d5c1c 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -711,6 +711,8 @@ xfs_mountfs( if (error) goto out; + strscpy(mp->m_super->s_sysfs_name, mp->m_super->s_id, sizeof(mp->m_super->m_sysfs_name)); + error = xfs_sysfs_init(&mp->m_stats.xs_kobj, &xfs_stats_ktype, &mp->m_kobj, "stats"); if (error) From patchwork Mon Feb 5 20:05:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 197042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1160319dyb; Mon, 5 Feb 2024 13:41:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmlAQVmPWmIMnG/E/FvZ7u5mczJf91gvR++o9bxznI9U6q8yVXBeOS9MMqgjEXSnJNkIw9 X-Received: by 2002:ad4:5def:0:b0:68c:7903:827b with SMTP id jn15-20020ad45def000000b0068c7903827bmr249008qvb.62.1707169274695; Mon, 05 Feb 2024 13:41:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169274; cv=pass; d=google.com; s=arc-20160816; b=ngx62jdvvQw9mSEI2BUvtTvb/6H0PEbhhGiEI8mpOu7PerpSUcQSfuhaF7+xveOI0V gamyIirVJyLA+X/wD4koY27LeZMD+VLQ8hFmo9/B2HgYe5m3uE+VJOfXfipk7gVNgCFg GQVvyB9VI4lf4uqYcLUBQAtpta/3UCPNIMTLOQL5T2i4yw4M2ATWPRNLyYbv7ThH9hv0 g+UenTC3hSOdKLilyD3UV2Q6DuKC3u1w9wYNR3OHOySQHtTCE0CRslCJ1enYiqU2/yuj PX+ruLn+JVmWoUdNdKGxcZQxIDDR52VNz4QOkQwOmswSUf8TJGqlvTvkZ/UoxE8bXqeY Ngxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NLVu6z9oDG9sN6mZGh4y4P6bs4UjmMpsBscmXPUe1bU=; fh=7tJBBxb7D4UOrqqB0DKhUeGrX+ga2r/m0ii06FN4m8E=; b=ssDgk8hSGAk4WT2ajoDcoDxk8xgOOF8HtkQ7FcYa2CUjQ+SXXHxRMAiDrFiovWSPuU MNe3fx9PrKSQ3SU4uQBscM87j6N6GxlP5cZnenrNxWWQenJF9RYWmCDrDoqqE+wLPPxx qdQLj3Uw4Ql9NjxFDpIZ9BuQE/Og/dPkV0p2cF6HZ7ncfP6BWJyVsJgScO19IzwLwhkV qOlNA+3xKLCmQffnOA+60/GbFIMSTxCmp9G8IZUBrkwJtGW5et8jtq2gwbqG28KjE/W8 EFDF4v2HCmrRx47GqkbWWo9l+9WzHkrlPeJrFN5qrxLn4V/EMCpRDy3SrVXBrZBRDhw7 OWng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PvxVcBYt; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53892-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53892-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCUex6hJGqiW5AK9yJdPjFBy3Nv1581Tq8PX/90yZNr5PJ4Z48IzFKEkgci+y0kq3V4sY1ovnqnxNG1ZR8JMOYLalbSd9w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vr16-20020a05620a55b000b0078544cd0c66si728104qkn.453.2024.02.05.13.41.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:41:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53892-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PvxVcBYt; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-53892-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53892-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 79AA31C279C1 for ; Mon, 5 Feb 2024 21:41:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5198212D165; Mon, 5 Feb 2024 20:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PvxVcBYt" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A84B612C521 for ; Mon, 5 Feb 2024 20:06:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163574; cv=none; b=BLCWMvY957+ra0x4vgX0Qb/dwAhRHIt1ihVDhKCZSCPG/0unXg/nPvHukXhFbG3/WOYlWHekfEEIDB8mk/4cMt7TYC7bnM/rUMg0hi25i+l4X3HKBSueArfBHPUNpSVdnB+mLrAFPk0QW2KbhwUzjjXslGMsWI2qLmHAUZr0i1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163574; c=relaxed/simple; bh=XgF3fY5kEN+vUXqGN7hKlRnAVg3Ylev2ReQ2bfeBKZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rXidVnczbV4o8ohUwe6UcTya1kP5CU6ht+x1U58lk00VRPALHJdjWcLzUTJI4UmOBHKW0K0bUgMpneA1U2DvPl44lPGiQmpnbYvy0UGC57o0Y+w8OTb+yHgt2lnTCXtMDL6xLz5xIPsDGDxmu8zDqOda03oossFcoHDcdLjdC7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PvxVcBYt; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707163571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NLVu6z9oDG9sN6mZGh4y4P6bs4UjmMpsBscmXPUe1bU=; b=PvxVcBYt7kYfaf12e30W3x0/H8h/HJO72Cemqvu76NHpwi78k4o2zorkFCEuaYAkT9nwB1 6GHJLaLgmqy4xQSlf/Z03MErkO7mBHraWYj6eTSIwBY2/H1VmgcZXTVjvKPvB4FOGj4fZL OmdQW4FtTPe1DR1sxWKgQfbIK56J9Hk= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 6/6] bcachefs: add support for FS_IOC_GETSYSFSNAME Date: Mon, 5 Feb 2024 15:05:17 -0500 Message-ID: <20240205200529.546646-7-kent.overstreet@linux.dev> In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev> References: <20240205200529.546646-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790096729073964584 X-GMAIL-MSGID: 1790096729073964584 Signed-off-by: Kent Overstreet --- fs/bcachefs/fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 77ea61090e91..50b2fd3ddd23 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1947,6 +1947,7 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type, sb->s_time_min = div_s64(S64_MIN, c->sb.time_units_per_sec) + 1; sb->s_time_max = div_s64(S64_MAX, c->sb.time_units_per_sec); sb->s_uuid = c->sb.user_uuid; + snprintf(sb->s_sysfs_name, sizeof(sb->s_sysfs_name), "%pU", c->sb.user_uuid.b); c->vfs_sb = sb; strscpy(sb->s_id, c->name, sizeof(sb->s_id));