Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3121965rwb; Mon, 15 Aug 2022 18:39:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR42wnDzq7BeCxEAoazZsw1lCjLo+cXaqPZ8CQarNsV4DLvkSgo+ZMXTg+ljrFycNuhJXeml X-Received: by 2002:a17:903:245:b0:16f:85be:f33b with SMTP id j5-20020a170903024500b0016f85bef33bmr19507568plh.96.1660613990421; Mon, 15 Aug 2022 18:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613990; cv=none; d=google.com; s=arc-20160816; b=Equp7TmKoqbX3Z+UxQ9POS/fMOU5Waey50I4bbyqDGgfuqoUP6+j+vErLDDTo0XpWc 2djEZYc+a/cMdYImZ8NtAW1k9ooIPAMO/yxVD2ll+mFiQiwvQHhmFTHUnKjFl53uroXy 77no1cg+IoA9RVzFHVBtqcEoX83WlrLgrkgf0/kmurKKgIQPbs/0eOb5D/g0atQy2miC Pg5nUClGobYWjhF1bSZcgcuFNcOSJqNklD+TLhNfqXb728J7YVJPyV8oXWPnccTRduH2 WsOseV5E+BRiMno2kiSkOhHDExeO66O2r6YYfy9h5nWXHdQLbPiUWf2k8n12UVUq7qm2 1ogw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lcU426bfHLI5y+BTAVXrtbUN2kRdUKhmVNSmtgzA2HA=; b=F9lzhNzaQ5nNioSJRdfGga/vWcqX+qEFs6QeBD9TVyQDtmNA9na2WKFg4btpdJ8p/4 A8fIYLrik2VYt0rbKGsjPtQoNMS9Mr7y7acPckI6tskxaEq4UXPJQpFcHGDP5w8XmaOi jDN1czkUPTPKEhZdZXdmb/fdG6jwa7ggpMh+SJRRYJiiblQC9oqts4PJr6Cx3NSLgwdT TkoTQR3QQZoFA6SMzxMnOHm3Jhd251A4+Jzl6BUfoTG/IIfxhHf1mTBMFlIxIfGvBI1t KYgYBhxNjq5IsIfCI7Ty5l6AgjdwxGfbX43gUQZjLiSD997Ja5QD0vX91XqH2YcP09LV S+tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WxH0GBtY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x189-20020a6386c6000000b0040c8a3cab3esi2894200pgd.638.2022.08.15.18.39.39; Mon, 15 Aug 2022 18:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WxH0GBtY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348335AbiHPBFV (ORCPT + 99 others); Mon, 15 Aug 2022 21:05:21 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) if (s->base) { + int offset = (char *)s->here - bs->bh->b_data; + BUFFER_TRACE(bs->bh, "get_write_access"); error = 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 = (char *)s->here - bs->bh->b_data; + } + unlock_buffer(bs->bh); + ea_bdebug(bs->bh, "cloning"); + s->base = kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS); + error = -ENOMEM; + if (s->base == NULL) + goto cleanup; + s->first = ENTRY(header(s->base)+1); + header(s->base)->h_refcount = cpu_to_le32(1); + s->here = ENTRY(s->base + offset); + s->end = s->base + bs->bh->b_size; - unlock_buffer(bs->bh); - ea_bdebug(bs->bh, "cloning"); - s->base = kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS); - error = -ENOMEM; - if (s->base == 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 = le32_to_cpu(s->here->e_value_inum); + error = ext4_xattr_inode_iget(inode, ea_ino, + le32_to_cpu(s->here->e_hash), + &tmp_inode); + if (error) goto cleanup; - s->first = ENTRY(header(s->base)+1); - header(s->base)->h_refcount = cpu_to_le32(1); - s->here = ENTRY(s->base + offset); - s->end = s->base + bs->bh->b_size; - /* - * 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 = le32_to_cpu(s->here->e_value_inum); - error = 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 = le32_to_cpu( - s->here->e_value_size); - } - iput(tmp_inode); - - s->here->e_value_inum = 0; - s->here->e_value_size = 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 = le32_to_cpu( + s->here->e_value_size); } + iput(tmp_inode); + + s->here->e_value_inum = 0; + s->here->e_value_size = 0; } } else { /* Allocate a buffer where we construct the new block. */ -- 2.35.1