From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbbCTDGF (ORCPT ); Thu, 19 Mar 2015 23:06:05 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:7391 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbbCTDGC (ORCPT ); Thu, 19 Mar 2015 23:06:02 -0400 From: Wei Yuan To: , , CC: , , , Subject: [PATCH] ext3: Remove useless condition in if statement. Date: Fri, 20 Mar 2015 11:09:10 +0800 Message-ID: <1426820950-4720-1-git-send-email-weiyuan.wei@huawei.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.197.243] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.550B8E91.00DD,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1337a1cfe38453bb98ff7d90303fc18f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In this if statement, the previous condition is useless, the later one has covered it. Signed-off-by: Weiyuan --- fs/ext3/xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index c6874be..24215dc 100644 --- a/fs/ext3/xattr.c +++ b/fs/ext3/xattr.c @@ -546,8 +546,7 @@ ext3_xattr_set_entry(struct ext3_xattr_info *i, struct ext3_xattr_search *s) free += EXT3_XATTR_LEN(name_len); } if (i->value) { - if (free < EXT3_XATTR_SIZE(i->value_len) || - free < EXT3_XATTR_LEN(name_len) + + if (free < EXT3_XATTR_LEN(name_len) + EXT3_XATTR_SIZE(i->value_len)) return -ENOSPC; } -- 2.1.0