From nobody Mon Sep 29 20:14:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA21BC00140 for ; Tue, 16 Aug 2022 01:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244659AbiHPBFZ (ORCPT ); Mon, 15 Aug 2022 21:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349582AbiHPA6d (ORCPT ); Mon, 15 Aug 2022 20:58:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE411A2E81; Mon, 15 Aug 2022 13:49:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 35CF9B811B1; Mon, 15 Aug 2022 20:49:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 775C7C433C1; Mon, 15 Aug 2022 20:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596587; bh=FMs/sWj9WFMQUIEfGyLx6NRo6/tJlhfm8nDKhrM5/EY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WxH0GBtYKkbr60INSNGiWq1DIUjcO2ANO4Lq+3ImhlVPlIva0AksPxIxVBufGl818 JXI+5mDNHj6YycO9l+ZjZqJ8dFtLwaS0F1ZeOjGRj9fW6paexuSMOzq6SOeI9Bix3a mUKOW4JfmdyH11ZOXYPVILPwU/YryeWNR3c46l50= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 5.19 1128/1157] ext4: unindent codeblock in ext4_xattr_block_set() Date: Mon, 15 Aug 2022 20:08:04 +0200 Message-Id: <20220815180525.497337396@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jan Kara [ Upstream commit fd48e9acdf26d0cbd80051de07d4a735d05d29b2 ] Remove unnecessary else (and thus indentation level) from a code block in ext4_xattr_block_set(). It will also make following code changes easier. No functional changes. CC: stable@vger.kernel.org Fixes: 82939d7999df ("ext4: convert to mbcache2") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220712105436.32204-4-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/xattr.c | 77 ++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index d92d50de5a01..a25942a74929 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1850,6 +1850,8 @@ ext4_xattr_block_set(handle_t *handle, struct inode *= inode, #define header(x) ((struct ext4_xattr_header *)(x)) =20 if (s->base) { + int offset =3D (char *)s->here - bs->bh->b_data; + BUFFER_TRACE(bs->bh, "get_write_access"); error =3D ext4_journal_get_write_access(handle, sb, bs->bh, EXT4_JTR_NONE); @@ -1882,49 +1884,46 @@ ext4_xattr_block_set(handle_t *handle, struct inode= *inode, if (error) goto cleanup; goto inserted; - } else { - int offset =3D (char *)s->here - bs->bh->b_data; + } + unlock_buffer(bs->bh); + ea_bdebug(bs->bh, "cloning"); + s->base =3D kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS); + error =3D -ENOMEM; + if (s->base =3D=3D NULL) + goto cleanup; + s->first =3D ENTRY(header(s->base)+1); + header(s->base)->h_refcount =3D cpu_to_le32(1); + s->here =3D ENTRY(s->base + offset); + s->end =3D s->base + bs->bh->b_size; =20 - unlock_buffer(bs->bh); - ea_bdebug(bs->bh, "cloning"); - s->base =3D kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS); - error =3D -ENOMEM; - if (s->base =3D=3D NULL) + /* + * If existing entry points to an xattr inode, we need + * to prevent ext4_xattr_set_entry() from decrementing + * ref count on it because the reference belongs to the + * original block. In this case, make the entry look + * like it has an empty value. + */ + if (!s->not_found && s->here->e_value_inum) { + ea_ino =3D le32_to_cpu(s->here->e_value_inum); + error =3D ext4_xattr_inode_iget(inode, ea_ino, + le32_to_cpu(s->here->e_hash), + &tmp_inode); + if (error) goto cleanup; - s->first =3D ENTRY(header(s->base)+1); - header(s->base)->h_refcount =3D cpu_to_le32(1); - s->here =3D ENTRY(s->base + offset); - s->end =3D s->base + bs->bh->b_size; =20 - /* - * If existing entry points to an xattr inode, we need - * to prevent ext4_xattr_set_entry() from decrementing - * ref count on it because the reference belongs to the - * original block. In this case, make the entry look - * like it has an empty value. - */ - if (!s->not_found && s->here->e_value_inum) { - ea_ino =3D le32_to_cpu(s->here->e_value_inum); - error =3D ext4_xattr_inode_iget(inode, ea_ino, - le32_to_cpu(s->here->e_hash), - &tmp_inode); - if (error) - goto cleanup; - - if (!ext4_test_inode_state(tmp_inode, - EXT4_STATE_LUSTRE_EA_INODE)) { - /* - * Defer quota free call for previous - * inode until success is guaranteed. - */ - old_ea_inode_quota =3D le32_to_cpu( - s->here->e_value_size); - } - iput(tmp_inode); - - s->here->e_value_inum =3D 0; - s->here->e_value_size =3D 0; + if (!ext4_test_inode_state(tmp_inode, + EXT4_STATE_LUSTRE_EA_INODE)) { + /* + * Defer quota free call for previous + * inode until success is guaranteed. + */ + old_ea_inode_quota =3D le32_to_cpu( + s->here->e_value_size); } + iput(tmp_inode); + + s->here->e_value_inum =3D 0; + s->here->e_value_size =3D 0; } } else { /* Allocate a buffer where we construct the new block. */ --=20 2.35.1