Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3087764rwb; Mon, 15 Aug 2022 17:49:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR5m4uHH1obXzdlP1//6EiBHAp9xfcE4Ku30dVvuKSbeHMhgKmrvFfq9PffKYeFP0ZEyElfI X-Received: by 2002:a17:907:2cf2:b0:730:d73e:acb7 with SMTP id hz18-20020a1709072cf200b00730d73eacb7mr11679155ejc.223.1660610990921; Mon, 15 Aug 2022 17:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610990; cv=none; d=google.com; s=arc-20160816; b=Gsxx30chZU9glPcDoGqAO2T8kMNg9IgFzWQakK3RUiyx53Ce0jTB12z8H5zHF9t4OA cKbFZqUlKt/51HiBH/eNX+M/k5YExTtivbu7Has2OhQ3eBcd+vTHFoteR93Fh1136Nef TPy91gGMB8kKeEf2J8PsODHKIrh4ppg17zGV8d3ZMig+w/8iA89J8GtKc2cDVicfS6yg lfQt9n7YIJr3L7E0QNtRpQqRMDV6EgDEbrwfS4EBZapWCodAtF0XVNik7PIy/5lxRwmN zTlyjIeeSbfamikl78ioxfrKapek68pH6LtREo1JQMg+tBjoAzJB5szr2+Fk2liIQE9H +/AQ== 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=l8GfWC0ol+gZB9AuvknqjmNCCFegmSvD5juMHo3hzih/06U44hsyo+GkPOpsZPz5Zf qPXy4OvR634uzM00zgX6i2wRgfdgqkwyQK+IyqfcHB6QpVoXE7r7UtW6yKSZC5bxcNkW EDxmAQ9Zp1/LgqAv2b/P0NqXqQ0iNWXXpm73nsM8H4iBcF/V6NlsusUrvNlf+YgkE0bW 3uA8axgg1QiKn3zX2AJIm2VFg1TS0JKu5CVbLwRHR60lQg3nOCtqlb7Ed9FRbOsAyspa YemRNz0IoSRScQa6Dl/5lgyfKT80GSxOYWSozXwGDNHPSdXK7M00Xp9lTQIjFJStmyYf V/wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0p1NqNdU; 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 y2-20020a056402440200b0043be7b8aebcsi9521633eda.97.2022.08.15.17.49.26; Mon, 15 Aug 2022 17:49: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=0p1NqNdU; 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 S233488AbiHOXj3 (ORCPT + 99 others); Mon, 15 Aug 2022 19:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353854AbiHOXgp (ORCPT ); Mon, 15 Aug 2022 19:36:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8037BCCF1; Mon, 15 Aug 2022 13:09:23 -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 02386B80EA8; Mon, 15 Aug 2022 20:09:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56FE1C433D7; Mon, 15 Aug 2022 20:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594160; bh=FMs/sWj9WFMQUIEfGyLx6NRo6/tJlhfm8nDKhrM5/EY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0p1NqNdUJdaQ0+wdlTySLPCOAz/knS3tpvh9lQ6294w95ngOHTKZHRAmAn1p53UzR aEPG4BO3NfDEuvGPZw7dDqEFmx8nsulCox+hv73OjWl/butlm/xhicaYsLOpieuUDq xOkcqBSWlEqtJcHdX6fO5Y5CyCxt6su2f4cQsTGA= 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.18 1065/1095] ext4: unindent codeblock in ext4_xattr_block_set() Date: Mon, 15 Aug 2022 20:07:44 +0200 Message-Id: <20220815180513.102937573@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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