From patchwork Fri Mar 15 03:53:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13593036 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 B5DCDD530 for ; Fri, 15 Mar 2024 03:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474802; cv=none; b=t3Xi5UKVjd3yrkBrHJp+ZXPAKN3OsBlAazVPOx8UjQqK9URU6LK7MHuS8o8HFvXbqQJ0xcHwArK+CbOAQlaAyoUAPwQwoyQWOvv3DLRs2jcJ3UkkSKk4KUfTCoY8WYT/C/c9sCSKQAX37vtCmD2IaIOgQcvbJIT3C9QbWqWlfvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474802; c=relaxed/simple; bh=/LueQ1G13mqVU1G0GdjbjC3M2usr9mpEcPu/Uaxz5sA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZmqdHHreAlivbqis2pnoNDXXfCakk5PsPJa0QbGHYEyPL4y7Z1uC0lqgb9r9Ni59vfCqiG3ske/GKZJ/VzDDyH/5WbxXuzf1dRrTY0qMOrlHcuuZtGE1Ccr0Dd0zsS61SdqmUJYvh1NWm9VWg83vaK/Ql9mGjF5mTrIsXYrx1PI= 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=jh0/rgLs; arc=none smtp.client-ip=95.215.58.188 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jh0/rgLs" 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=1710474798; 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=0gsmBQw4bUZ2D0XG7tW7X5KxLNhuOa5nEfyJ0hbF4Nw=; b=jh0/rgLsvq+FTJEEueBkFHFB0Y2sj+exqZBFAxRCPMtcQ0cm9Kh3AzXvnvBgaXxhKk9cLW LNreMPbNb5jXwQNOl2E9v4O7CL9Ge78QBx1R88jMTtkBRzMeQGxkWJE5YAd1Zo4opcg9pk /J/JdcenZfUvnDwy9IKOYkC99Nr4+NY= From: Kent Overstreet To: torvalds@linux-foundation.org Cc: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner Subject: [PATCH 1/3] bcachefs: Switch to uuid_to_fsid() Date: Thu, 14 Mar 2024 23:53:00 -0400 Message-ID: <20240315035308.3563511-2-kent.overstreet@linux.dev> In-Reply-To: <20240315035308.3563511-1-kent.overstreet@linux.dev> References: <20240315035308.3563511-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT switch the statfs code from something horrible and open coded to the more standard uuid_to_fsid() Signed-off-by: Kent Overstreet --- fs/bcachefs/fs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 77ae65542db9..ec9cf4b8faf1 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1572,7 +1572,6 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf) * number: */ u64 avail_inodes = ((usage.capacity - usage.used) << 3); - u64 fsid; buf->f_type = BCACHEFS_STATFS_MAGIC; buf->f_bsize = sb->s_blocksize; @@ -1583,10 +1582,7 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_files = usage.nr_inodes + avail_inodes; buf->f_ffree = avail_inodes; - fsid = le64_to_cpup((void *) c->sb.user_uuid.b) ^ - le64_to_cpup((void *) c->sb.user_uuid.b + sizeof(u64)); - buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL; - buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL; + buf->f_fsid = uuid_to_fsid(c->sb.user_uuid.b); buf->f_namelen = BCH_NAME_MAX; return 0; From patchwork Fri Mar 15 03:53:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13593037 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 A424ED534 for ; Fri, 15 Mar 2024 03:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474803; cv=none; b=lB5U/Wpm5CpbqA8kffwJGkl1TRrDgR1iDgZosbyi33JLnHYyjvDSwStty6R+bIE0SEeiORQRAQL4/O+vMFHC6Uv/WF5rvElasHi7N29eqqU0l8Chp6bBLxy0uf0zQaENKNry31eUhlMDt+Tf8/2rOgGhe4mKj9UOX24SDG1jVro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474803; c=relaxed/simple; bh=ETe7xjHWW1b2dyWEqu+mzr7jH/S4kWsRcee5sNWNUGs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RWqikZ9XZ07JZbk3nKpwIPds2nNiDQoMxbtDBqxLCGQrcHDQwlORFld19jMeeMx0fB8L3d5fTBfwZePTpATcBO89Wd5Xoghe9k2pFecYskwDMdhuGr92DteyHK6maSKt/ulr1UCp3LlfLVxOKG8f/1d97cc2u8BHETROFYxh1Ws= 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=u5D6vHOw; arc=none smtp.client-ip=95.215.58.186 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="u5D6vHOw" 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=1710474799; 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=38/wt83nJ9aR6snVd8vXn5qYmIdiido/GJdtnp1qpj0=; b=u5D6vHOwZvchQp6ixuQd6dz4r6idaKFDKTcaZiRCoPeUnOz8dkiLIFPU+hPcDyLUey1wgr IX7H4UpcQloK5ugvhmpX6jlrV0aR6xfjja6TYxY+toxhvkT82pa+KrWZel/Nwjx0dwoGmU h6sds6520v3+duicIQ6eg7ID/7ou+Hw= From: Kent Overstreet To: torvalds@linux-foundation.org Cc: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner Subject: [PATCH 2/3] bcachefs: Initialize super_block->s_uuid Date: Thu, 14 Mar 2024 23:53:01 -0400 Message-ID: <20240315035308.3563511-3-kent.overstreet@linux.dev> In-Reply-To: <20240315035308.3563511-1-kent.overstreet@linux.dev> References: <20240315035308.3563511-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Need to fix this oversight for the new UUID/sysfspath ioctls; also, initialize the sysfs path. Signed-off-by: Kent Overstreet --- fs/bcachefs/fs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index ec9cf4b8faf1..cfc9d90ab179 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1881,6 +1881,9 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type, c->vfs_sb = sb; strscpy(sb->s_id, c->name, sizeof(sb->s_id)); + super_set_uuid(sb, c->sb.user_uuid.b, 16); + super_set_sysfs_name_uuid(sb); + ret = super_setup_bdi(sb); if (ret) goto err_put_super; From patchwork Fri Mar 15 03:53:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13593038 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 DF32BDDDC for ; Fri, 15 Mar 2024 03:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474805; cv=none; b=rnu+aMEWF0xhKoftXQlJfmVvLlhJuDOl0rpC/pm4mUhLME7W2MNLRtfrUP380KjLfnTZV836iiOtycEM/f+3VWxSJ1gv/nw9s1KOLELdms5Im7NcUQ88mZQlOoqlaVtqdb7D3Tyrvk87b75K5fW/489yO7AqvIDf6o3izMRhJo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474805; c=relaxed/simple; bh=2qMcRbP6ZzThdZGcEPqIsQjXmXA3HO46JfwlDTtZ19U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=otzhRaFhsrZRpgtBXHzaTwuAK4s/5kQk3cTgXAeI/rjvvHaDNOAj/6xXPwEjjc+cAJizz1QGjth63vPb+Taquk60fchHG042YWQ9Wzfoysn72rmcFrMnRw6ugL6IWCif499eGfFl5Ij3CGlO2TSFuxNjLvdoymGw77wd/ZvTOus= 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=TnHAHl0j; arc=none smtp.client-ip=95.215.58.189 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="TnHAHl0j" 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=1710474801; 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=b3OAWR1YN5Ue1DLQYdfxGHPlfZVSaTst3605+wbzFMA=; b=TnHAHl0jBxYCvli6JJtoKK/AtikrGpOLfgq7u/0ZkCZQOE2uOLetAjUV0IUkWDUBWea72i cLleOiAoaNZld7uFCI+Y8geW8Kjdgt+4waqGIp+DLgJObRUzJDTaJSzSYHHxgpqsGhJDrH r5RjBjisWhBPThMRlpbLGRbcqqFbR8I= From: Kent Overstreet To: torvalds@linux-foundation.org Cc: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner , "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org Subject: [PATCH 3/3] ext4: Add support for FS_IOC_GETFSSYSFSPATH Date: Thu, 14 Mar 2024 23:53:02 -0400 Message-ID: <20240315035308.3563511-4-kent.overstreet@linux.dev> In-Reply-To: <20240315035308.3563511-1-kent.overstreet@linux.dev> References: <20240315035308.3563511-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT the new sysfs path ioctl lets us get the /sys/fs/ path for a given filesystem in a fs agnostic way, potentially nudging us towards standarizing some of our reporting. Signed-off-by: Kent Overstreet Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f5e5a44778cf..cb82b23a4d98 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5346,6 +5346,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; #endif super_set_uuid(sb, es->s_uuid, sizeof(es->s_uuid)); + super_set_sysfs_name_bdev(sb); INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ mutex_init(&sbi->s_orphan_lock);