From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795958630; b=e2nfgaC0Yl7G7xnSmmAYTCDQYSMSNxR5/SF/5Jtt6TYLGIg6rnOkaheoFyBAVa3HJ0vJ KuAm3Flnnn16CqIoZSlT/sSZxcSV43ADbpsCl2ZeMKMht1MRrN0iGXDvBTa2sr9lKpON4 Ls9zNSiE24yK6jriPZN3C/B7AgbV3SEK187Uw1sJAReXHBrTkItjMen/mVUx6lJXgLK8l u5G6MSgEh4K8xvc4eE6lIvVW8V5Wn1Lp2fRSTI+x2RS/f6Gn8i+HQ7EkJh9CqUu2Ll5WN yMghfItSSs04HYIyB6O1c/FU4173Z5sKq4GtjWJW06UOZTdVB55v59h7AO8j1tkcw/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795958630; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To:X-Mailer: References:In-Reply-To; bh=UYyubKbkGKqhzIw6voszTOYbdoDf2fzW+U0HJ6tVmJE=; b=oXqS71cP2TiHFQ+M6pOEyvNkuzo1RfefZVBF5PlRJperftIouwAGzN3LD15zTDPReZ2S K3SPcdhZ0UDJuqxNvZDXmUD+GhU1jU0TtlGEshhWJMINjLRM/jIH066Y5VN7Ii7TamHvB vHur4sXpihYGmSrcMNizeCbVNx3CwC+5BzNNEu0pIvXpP6LGJslDNjbvPPECEEkhWmATR 1mXBy6rT7DVlZbBcshhXBGt4nZxY4BfQq5ZKgkA6lz6AE9LG+88Qsj1eyFbHn0bFyfgf9 6H2ReacKreBvHceOEbUHsl/AVc5W2b+404k8IT7ggyhftzXmQfX2alKUK0O2Zyowjcg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=01GDs+ZT; arc=none smtp.remote-ip=209.85.221.54 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 781CE606A330 for ; Sun, 29 Nov 2026 13:23:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 781CE606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=01GDs+ZT Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-4a3e706b5dfso5986867f8f.2 for ; Sun, 29 Nov 2026 05:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795958629; x=1796563429; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=UYyubKbkGKqhzIw6voszTOYbdoDf2fzW+U0HJ6tVmJE=; b=01GDs+ZTc3kDIrASsSG0zGqq6bC9w64t6d9euqyTBW0C/1CB5F+b/DIe00M3Ajfcm/ 7us4WUCsqQOZfXJHgRQMgCod5J8V8f2EHSaBbcUTVqc0CVxZSQ/wOTHQRN/TC5v9czXJ XGRpXEra/VkrYaS3fdk75qeECT1q1PJViNX/8JgNIYjmD/Btcsoj+is8JVr4MSXXITcI gOhp5jxFAVVpqlf24Wd6k0fpC5SGvGXbmsA/F2pWnQA5GO0b2J3N6xd9QVcu7fqxY6pQ qvZyMBKfTZmUWsCZXGL42km96SjmkO7WuQdyJjkP1mnuSB94ieKwuPA1/PdyImyxBu3M j2dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795958629; x=1796563429; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=UYyubKbkGKqhzIw6voszTOYbdoDf2fzW+U0HJ6tVmJE=; b=M6HH6Np2v/nRVemtmEq8ytckO5+fze410ysNCDINQZ4YotbmNpgvUos9cYo6M0B7Dz cyUt8otor6EeUqi1o/3/HIhR9UYj8+IH0Y+9c31pHOhmlCvyIf8IU+ZE9+7lmpzyVVEJ u6HH20WP3EnN2vv1d3bSIKIx0HeafSKhEsGLlQQ6yzh6aisrlXlqCM6gHtWu6qAyAuLx ZpRcBH2MzN0JoIRVvAFbuqv/+r1XxhbgtMqHTfqsMLXkwvb6jC0jrXsaoKMj+QtWA9IQ RrzirLwDx1Lc49jnn2SFBbj9uXFxDOPnXGNRpCQRUpBl5EB59EeQ43QbxalIgWYcihpa ip8g== X-Forwarded-Encrypted: i=1; AL+hErHaHHY7cV5P5LT+RUe4KlOcmAlhPx76jTHCIf7O6/ApnGgKLAN2GTu1FzcR6UY71ver4WGtDLnJlJkK/Q==@vger.kernel.org X-Gm-Message-State: APuU4Z++cjz8wRLIWdHQE+3H7A69La/Oa3y09WSiw7hWe9DZ5EPaGFmw wzkvHHQj4wxaFPRrXgCcaqzBnFhqymwVKrEpcXqpSqOKSb7Gk7twX3CR X-Gm-Gg: AZFdTZceVXArKR312h9Z2n5CuPg60Tue5HRhY//rKrHnPXmxcuXcmTQ1YLGGQW4jIHc H3tjYuvxt8AWWf3OnhECx2//r8x/xzQzEVUv7S0fWoctT0s7m2/JlNfyJY0LcAMNm77PM9U+HcT ZpZOQH77keq0r6YR8dd2YxILNBS6Y+dFQkmcAt0vDNhyiGXBnvLNPSzxlHuzonA2zorupJc6BUY fLG1JiANkt8OMUuBN1qNSXu8GS3/zEQ6G74yzx/+eaO7aLPRNcpN4saklx0lTyfuS7HqpyWUUp/ LD3kPHf42pvvtjJb8wCAa4iu+IzT8qdJSPRyCRGFVOhCO2MED22pRzJ21SkVl6xXm4pCvcLU5nc hv7BC2XGZHLhpP9GQSXwB6f43A7VH4W6BQsgAl4XV9TcfrsUOpBl8HKtZoCt/mCKO++y2o2k+MX dbIM98iyQp8ZPj+s9CvD1L/Dt0r5/wIxkxoUyjeO3bDvb7FVKy28beWRFsMZpFIrLn6UH2np7iV Kmh2SyUJ88nqkUiXZVJliEFbQFV2FnmV3U98s5t3Mw32tBA6eIvA3xCnxCg+UUJAxSAbdRdaXll ncapkMNCrwPL5oBi9oy/o5yg/A== X-Received: by 2002:a5d:5e85:0:b0:492:b5d9:f627 with SMTP id ffacd0b85a97d-4abb6eed70bmr52894425f8f.46.1795958628541; Sun, 29 Nov 2026 05:23:48 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c61e53asm64290957f8f.59.2026.11.29.05.23.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2026 05:23:47 -0800 (PST) X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Type: multipart/signed; boundary=43ec91f6d9d32f89167321fcd311b2ce8f798f39d9b40e0d4aefb9c514c2; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Sun, 29 Nov 2026 14:23:46 +0100 Message-Id: Cc: "Namjae Jeon" , "Hyunchul Lee" , "Jonathan Corbet" , "Eric Biggers" , "Theodore Y . Ts'o" , "Jaegeuk Kim" , "Alexander Viro" , "Christian Brauner" , "Shuah Khan" , "Randy Dunlap" , "Chuck Lever" , "Jeff Layton" , "Jan Kara" , "Alexander Aring" , "Darrick J . Wong" , "Andrey Albershteyn" , "Miklos Szeredi" , =?utf-8?q?Pali_Roh=C3=A1r?= , "Lauri Gates" , "Christoph Hellwig" , "Dave Chinner" , , , , , , , , , Subject: Re: [PATCH v3 1/5] vfs: use goto out on error in vfs_fileattr_set() From: "koraynilay" To: "Amir Goldstein" , "koraynilay" X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261129024233.2361718-1-koray.fra@gmail.com> <20261129024233.2361718-2-koray.fra@gmail.com> In-Reply-To: --43ec91f6d9d32f89167321fcd311b2ce8f798f39d9b40e0d4aefb9c514c2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Nov 29, 2026 at 10:32 AM CET, Amir Goldstein wrote: > On Sun, Nov 29, 2026 at 3:43=E2=80=AFAM koraynilay = wrote: >> >> Switch from using if (!err) { ... } to the cleaner if (err) goto out; >> in the main body of vfs_fileattr_set(). >> >> Signed-off-by: koraynilay >> Reviewed-by: Andrey Albershteyn > > Reviewed-by: Amir Goldstein Thanks. > A note about RVB/S-o-b order. > This is not a rule and not universally followed practice, but for me > S-o-b is signing the entire contact of the commit body and commit > message above the S-o-b which includes the RVB collected by you. > > If this was a standalone patch and Christian would be picking it up > to vfs tree based on our RVB, the history records will show > S-o-b: koraynilay > RVB: aalbersh > RVB: amir73il > S-o-b: brauner > > But if you posted v4 first and Christian would pick the series later > history records would show > > RVB: aalbersh > RVB: amir73il > S-o-b: koraynilay > S-o-b: brauner > > I think this is a more accurate representation of the change record. That makes sense, I was indeed unsure on how to order them. > This is definitely not critical at all, but since you are developing your > developer SKILLs, I thought this was worth mentioning. > > And also if it was not clear: > - You never need to post another revision of a patch set if all that > changed in RVBs. This is something that the maintainers pick up when > applying the patch set > - Please take care to carry RVBs yourself in following revisions, as > a sign for reviewers that nothing has changed since their last review (Added yours now on my tree so I don't forget ahah) > - Please do NOT remove RVB for minor changes! > This rule requires judgement and common sense and the definition of > "minor changes" may very well depend on the reviewer, so if unsure > you can ask, or better yet remove RVB and write in notes after --- > what changed since vX, so the re-review becomes less of a burden Thanks. koraynilay > Thanks, > Amir. > >> --- >> fs/file_attr.c | 45 +++++++++++++++++++++++---------------------- >> 1 file changed, 23 insertions(+), 22 deletions(-) >> >> diff --git a/fs/file_attr.c b/fs/file_attr.c >> index 833e03810b24..40d6518f1d8e 100644 >> --- a/fs/file_attr.c >> +++ b/fs/file_attr.c >> @@ -285,30 +285,31 @@ int vfs_fileattr_set(const struct mnt_idmap *idmap= , struct dentry *dentry, >> >> inode_lock(inode); >> err =3D vfs_fileattr_get(dentry, &old_ma); >> - if (!err) { >> - /* initialize missing bits from old_ma */ >> - if (fa->flags_valid) { >> - fa->fsx_xflags |=3D old_ma.fsx_xflags & ~FS_XFLA= G_COMMON; >> - fa->fsx_extsize =3D old_ma.fsx_extsize; >> - fa->fsx_nextents =3D old_ma.fsx_nextents; >> - fa->fsx_projid =3D old_ma.fsx_projid; >> - fa->fsx_cowextsize =3D old_ma.fsx_cowextsize; >> - } else { >> - fa->flags |=3D old_ma.flags & ~FS_COMMON_FL; >> - } >> - >> - err =3D fileattr_set_prepare(inode, &old_ma, fa); >> - if (err) >> - goto out; >> - err =3D security_inode_file_setattr(dentry, fa); >> - if (err) >> - goto out; >> - err =3D inode->i_op->fileattr_set(idmap, dentry, fa); >> - if (err) >> - goto out; >> - fsnotify_xattr(dentry); >> + if (err) >> + goto out; >> + >> + /* initialize missing bits from old_ma */ >> + if (fa->flags_valid) { >> + fa->fsx_xflags |=3D old_ma.fsx_xflags & ~FS_XFLAG_COMMON= ; >> + fa->fsx_extsize =3D old_ma.fsx_extsize; >> + fa->fsx_nextents =3D old_ma.fsx_nextents; >> + fa->fsx_projid =3D old_ma.fsx_projid; >> + fa->fsx_cowextsize =3D old_ma.fsx_cowextsize; >> + } else { >> + fa->flags |=3D old_ma.flags & ~FS_COMMON_FL; >> } >> >> + err =3D fileattr_set_prepare(inode, &old_ma, fa); >> + if (err) >> + goto out; >> + err =3D security_inode_file_setattr(dentry, fa); >> + if (err) >> + goto out; >> + err =3D inode->i_op->fileattr_set(idmap, dentry, fa); >> + if (err) >> + goto out; >> + fsnotify_xattr(dentry); >> + >> out: >> inode_unlock(inode); >> return err; >> -- >> 2.56.0 >> --43ec91f6d9d32f89167321fcd311b2ce8f798f39d9b40e0d4aefb9c514c2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCawwnYgAKCRDmj22qf5IG XC2lAQC8sjO2+3RVrVwxqXBqYPDycPhJJOs76ftrtj8C7kYhOgD+N22fSHi8SL/+ /WVxi1icq8/+B1DM2RWVmn9v6Ryzlgw= =wsyt -----END PGP SIGNATURE----- --43ec91f6d9d32f89167321fcd311b2ce8f798f39d9b40e0d4aefb9c514c2--