Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1114623imm; Wed, 1 Aug 2018 10:25:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgperokDfNDLsSExjSk1+2/Lxw/HiqW9M6ynsPZ6BRNoOReTvybcFxOKDAM5vnIxDO6J005Gw X-Received: by 2002:a62:3f99:: with SMTP id z25-v6mr27830216pfj.250.1533144311997; Wed, 01 Aug 2018 10:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144311; cv=none; d=google.com; s=arc-20160816; b=kDeONQw+jjbrA263FkTbij+WpzlmD+V6FhwHZuzWOkjzlkya4jOlQzZdfGU6UxXE3R K6tH1YSvjYMNjgZC6YZ8UstCnQt/klAkDtdNH3zUZ95pCoLZ3wtkRsaVp5jCQEKm+kHE hqevQNjQh+l7EqTMYLbSfplKPzZgb0LYT2ca3RX+YBNiLfm4BcSpy+wyYqgRjKvvMyX8 oGGEnJ6CUXhI3zdWr5OsIu6iNJsnfky7sWTd8ajDwpEe5qb6sFDf85lzU1/zHUP8NRZ3 +6Yvw54qtYR3j9m0yVHJ/X5elezhOiVCm7Rn0bhc2XOXBzJekzOqAaJI95B7HMczxogB JiTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mZJS42oRHAWVOSfHuAQrLVt8jL5kvAYIBQTsBY0FXKo=; b=I0enePv+Y1DVTHypaXobNtofjVO3AWRqYqtuew5qYbtHOo3JGVwP+wFuk1CSkYwFpx TCXdy06bqp90wE7Rh87ajZiVrqQsGUPaxPTiPGnwS3uV3qtWynbKtQ1h6BTMRU+DD9kX +CtLV6c3e/PNXMv2zKNWMAQbvPLwW0Rs0E3nBvLylhzPE2cuBpwdDrInMH+Ayn0Ij5bm WF+FXfligFbydjCXkr3BpIjbIBnlELsIci9Zc6rVUUqId+sJNKq73ZYjdHgDY7y5tX56 jFLTombxCZ2tq4wlE71yzt3koP6JjdDt0cMIwS6q/RVxgndzQF6he9ECcyNxpoSuo2/6 UysA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9-v6si16104712pfg.27.2018.08.01.10.24.57; Wed, 01 Aug 2018 10:25:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390407AbeHATKP (ORCPT + 99 others); Wed, 1 Aug 2018 15:10:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50956 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389790AbeHATKP (ORCPT ); Wed, 1 Aug 2018 15:10:15 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 17AFFCC3; Wed, 1 Aug 2018 17:23:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "John L. Hammond" , Dmitry Eremin , James Simmons , James Simmons , Sasha Levin Subject: [PATCH 4.14 194/246] staging: lustre: llite: correct removexattr detection Date: Wed, 1 Aug 2018 18:51:44 +0200 Message-Id: <20180801165021.012075592@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Simmons [ Upstream commit 1b60f6dfa38403ff7c4d0b4b7ecdb810f9789a2a ] In ll_xattr_set_common() detect the removexattr() case correctly by testing for a NULL value as well as XATTR_REPLACE. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10787 Reviewed-on: https://review.whamcloud.com/ Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/xattr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -93,7 +93,11 @@ ll_xattr_set_common(const struct xattr_h __u64 valid; int rc; - if (flags == XATTR_REPLACE) { + /* When setxattr() is called with a size of 0 the value is + * unconditionally replaced by "". When removexattr() is + * called we get a NULL value and XATTR_REPLACE for flags. + */ + if (!value && flags == XATTR_REPLACE) { ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_REMOVEXATTR, 1); valid = OBD_MD_FLXATTRRM; } else {