Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3274773rdb; Tue, 6 Feb 2024 12:19:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzCXoCLcHTkaQ9Z4gIYFmx0CrydBv8gQcbNYMEFOo4zPjeJwyNhQRKX/08K+jm7+QM/jAn X-Received: by 2002:aa7:c2d3:0:b0:560:7e85:2ce with SMTP id m19-20020aa7c2d3000000b005607e8502cemr2561130edp.15.1707250784115; Tue, 06 Feb 2024 12:19:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707250784; cv=pass; d=google.com; s=arc-20160816; b=IamwERQbO8zr/cMPvr2hL1WgTRuHNLG9xMJOrf1M9XzMLN+S/rgF0VLkSRjIp6i4jj wPHjm4Y3ri0SkGNn72LeYTITzh/JYfgHK6YjPtX3BWjtxpvcZwqkzI7W6f7YGEYFyTEm 6O1tW7in4911x1sHq7fQnIPbWEyYOg27ptslmT0ZwbtG3T77YccYwWfGjdj1KMvV6sp0 swwDkZIXJGn500B/ITnTT4dGRVccnDOf9YFVr4x10WFLVvTOMUY3bybmE+RZ2ZjAaFM1 tIlxtsS1D3sBiKeV7+RM6GzLNg5AatLmhL5PG9kRRv+qA6Emc1ESmAxS1uLRjGMXblM7 uZsw== 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=UNJ5lQuPym878v0er8vpFPNJuyo1lBu3+aim1D8jyPw=; fh=GIasWeAbF9c1BaSZ1uoAlz8XwtYK8b4zFB0humXB00g=; b=nKGzXauzSgLrrsZ39qlcJJkwHa/tVZD+sFI3z3cy3mMfDwTLb8mMuhl6mkpNe+CX5O wNbBSotceLahBfwtlTpQsEGUpVEKWLA7OapjKudsEA6MTijCTILYdpzhKRClBUMhtkD1 TrRHtHxejJNwefTHqPaFLNHrVkIDYDUwr+nFKZvLIJpdBBST9xsjwyeK0ZeD6cKgjDSv OrrvVFrKcvtCpjlVPq5qvbH/xXSXAuAZ10odwFYGa/cprCvoJAZ28UtislQAHan9w4qb oGv9aK6BlbR+4FzVofptdFOICvq285xTsXjQhtDXZQk0StsvsOoHPsZtILPnIlPkkfa+ eHGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OhqAo2ny; 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-55583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCWdSP6sP6rBRQc77SQ217uzkhVL6R/1AJOqTgxGSZRPsGncymNMil2U5hfrCwBWmMa1fF8zc87Bbfa0Ve9dzyOI1ewGmAz7ra0fmUPjiQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g1-20020a50d5c1000000b0055d33a14abasi1511586edj.367.2024.02.06.12.19.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 12:19:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OhqAo2ny; 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-55583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55583-linux.lists.archive=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 D85E91F25D55 for ; Tue, 6 Feb 2024 20:19:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA99B1B7E5; Tue, 6 Feb 2024 20:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OhqAo2ny" Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.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 56D6617BA3 for ; Tue, 6 Feb 2024 20:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707250753; cv=none; b=EZViW/SyLw6ibdmunW95JbXJcktjAEJtd52KvK1LZcKIR5uSfPyqYJoFtXiGM6H+jB00M0HxsJ7sdm13+SKhp6zaArjp36Aw42HaPSs/xGM2pDOQzL06ciqODAXEUqtV/FQR2jxV285ao7/oz+xmGKc0Aft1wHtJOR0a7H3YD7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707250753; c=relaxed/simple; bh=n3McJjJh/WLCQm3zWRum7CJcJhpjLROkO/Uv6o5ddcM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hOrvNkme+/GuRytXWglxwMuoWyQdWELkkZ94VffVn8iHMaVVaL9aec8HVvpnOFfnLVNqD9LknZvanDOKKFY0xfOW6+W0GfHGJ38/OfWM2tJPXR3iS8VY/w3mcFUtQ0Dfveb+3t3R8Tt0rgU0/zUTc/6XhiYsUDNiDKOo6cE5s9Y= 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=OhqAo2ny; arc=none smtp.client-ip=91.218.175.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 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=1707250749; 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=UNJ5lQuPym878v0er8vpFPNJuyo1lBu3+aim1D8jyPw=; b=OhqAo2nyn+QVkXwlDoLVABeH4M1vXv0DMDYC6gNSNbDYa5Rd5PtFfzkmSkyMfI8nk8/BK5 TM0nhld+LO/gbU7Str1jdj+3e7cCMVMy8aBV8ig2dfLFKrtgcjW4moH2uS4NIvuoJkMftz Q7wFSn7haiI7X3b8Mklge47WtX3EAqI= From: Kent Overstreet To: brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Kent Overstreet , Miklos Szeredi , Amir Goldstein , linux-unionfs@vger.kernel.org Subject: [PATCH v2 2/7] overlayfs: Convert to super_set_uuid() Date: Tue, 6 Feb 2024 15:18:50 -0500 Message-ID: <20240206201858.952303-3-kent.overstreet@linux.dev> In-Reply-To: <20240206201858.952303-1-kent.overstreet@linux.dev> References: <20240206201858.952303-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 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT We don't want to be settingc sb->s_uuid directly anymore, as there's a length field that also has to be set, and this conversion was not completely trivial. Signed-off-by: Kent Overstreet Cc: Miklos Szeredi Cc: Amir Goldstein Cc: linux-unionfs@vger.kernel.org --- fs/overlayfs/util.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 0217094c23ea..f1f0ee9a9dff 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -760,13 +760,14 @@ bool ovl_init_uuid_xattr(struct super_block *sb, struct ovl_fs *ofs, const struct path *upperpath) { bool set = false; + uuid_t uuid; int res; /* Try to load existing persistent uuid */ - res = ovl_path_getxattr(ofs, upperpath, OVL_XATTR_UUID, sb->s_uuid.b, + res = ovl_path_getxattr(ofs, upperpath, OVL_XATTR_UUID, uuid.b, UUID_SIZE); if (res == UUID_SIZE) - return true; + goto success; if (res != -ENODATA) goto fail; @@ -794,14 +795,14 @@ bool ovl_init_uuid_xattr(struct super_block *sb, struct ovl_fs *ofs, } /* Generate overlay instance uuid */ - uuid_gen(&sb->s_uuid); + uuid_gen(&uuid); /* Try to store persistent uuid */ set = true; - res = ovl_setxattr(ofs, upperpath->dentry, OVL_XATTR_UUID, sb->s_uuid.b, + res = ovl_setxattr(ofs, upperpath->dentry, OVL_XATTR_UUID, uuid.b, UUID_SIZE); if (res == 0) - return true; + goto success; fail: memset(sb->s_uuid.b, 0, UUID_SIZE); @@ -809,6 +810,9 @@ bool ovl_init_uuid_xattr(struct super_block *sb, struct ovl_fs *ofs, pr_warn("failed to %s uuid (%pd2, err=%i); falling back to uuid=null.\n", set ? "set" : "get", upperpath->dentry, res); return false; +success: + super_set_uuid(sb, uuid.b, sizeof(uuid)); + return true; } bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, const struct path *path, -- 2.43.0