Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp519760ybi; Fri, 31 May 2019 05:12:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/S9NkNfSDzycyNZXqdJJBXBLAI9Ec8V7RmSbs7+XgxhSMjZ6NDjGSxkKy6nrCqYlfZE5Q X-Received: by 2002:a17:902:a986:: with SMTP id bh6mr6967294plb.100.1559304725138; Fri, 31 May 2019 05:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559304725; cv=none; d=google.com; s=arc-20160816; b=G8plU9Mc725QeAV9xfLuZH0lrhKPMcpF51uh5+jWlt8+wtNIKgUNV/406sdKC4AcoD 8pO5tu8j7vdnN+ff1hqyrSUtk7Q+ibYFGhIfOZESSEI+kcN5jPA4t1ok874H9co1Xhfv 7+2mZlYhXs1A+fS9tWK1NdzxL6EjZBhSeXUDb3ud1MiEh7HME15vogc8F/tPOO0+FN8+ 9fpjbqQ3ZAzrzMQyHktfkF7Ays1KWV6DqhbLoPJh0jj2ovQD8U676I69hAqmg0VC9dgk 79pXuNC4FUMS/RG9AfLveabPMRMsEwKrPr4mgAN4YnJ36Q6aeFI7xxBaSlhgpUk5RR08 wQPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6gP6IEJyv0wil1Hi+Rr68PAJrhW90pArzACg7owwhlo=; b=u9Wqer0X+HiJAZ9SKlGJXHvZjrt6zvsiB2QXFJ6NvFgXcLTeMqYWDr421bOGS42hLF cN5BwPWi3uOWaLFtrWhHkRD8u8ma6S/BY6xguuClV3YTXdEOq3KnRSwsUJGj1nxYQdk5 HSv+A/lykc0D3f1/gwmLUtCRkc7deyuuP5SWP5U7wJSUfzH6zVQWJwfC0/62XxycvFFj 75bJEaxBesOaMx0AwerygOXYwgTkI+ftI+GQ+d6P2/BsHPEXoeDBBxfjNJEHD53IW+SC +uU3KGc/vfhBo6wOhDzmCYDAdFlQ+WNtWs0tuGjbDDEFdKhIWVt7CRY+WuQ5sfSX0HyQ B+QA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si4337149pgq.293.2019.05.31.05.11.47; Fri, 31 May 2019 05:12:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbfEaMKZ (ORCPT + 99 others); Fri, 31 May 2019 08:10:25 -0400 Received: from relay.sw.ru ([185.231.240.75]:35534 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727149AbfEaMKY (ORCPT ); Fri, 31 May 2019 08:10:24 -0400 Received: from [172.16.24.163] (helo=snorch.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hWgMU-0004eV-10; Fri, 31 May 2019 15:10:18 +0300 From: Pavel Tikhomirov To: Theodore Ts'o , Pavel Tikhomirov Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: remove unnecessary gotos in ext4_xattr_set_entry Date: Fri, 31 May 2019 15:10:16 +0300 Message-Id: <20190531121016.11727-1-ptikhomirov@virtuozzo.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the "out" label we only iput old/new_ea_inode-s, in all these places these variables are always NULL so there is no point in goto to "out". Signed-off-by: Pavel Tikhomirov --- fs/ext4/xattr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 491f9ee4040e..ac2ddd4446b3 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1601,8 +1601,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i, next = EXT4_XATTR_NEXT(last); if ((void *)next >= s->end) { EXT4_ERROR_INODE(inode, "corrupted xattr entries"); - ret = -EFSCORRUPTED; - goto out; + return -EFSCORRUPTED; } if (!last->e_value_inum && last->e_value_size) { size_t offs = le16_to_cpu(last->e_value_offs); @@ -1620,8 +1619,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i, free += EXT4_XATTR_LEN(name_len) + old_size; if (free < EXT4_XATTR_LEN(name_len) + new_size) { - ret = -ENOSPC; - goto out; + return -ENOSPC; } /* @@ -1634,8 +1632,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i, new_size && is_block && (min_offs + old_size - new_size) < EXT4_XATTR_BLOCK_RESERVE(inode)) { - ret = -ENOSPC; - goto out; + return -ENOSPC; } } -- 2.20.1