Received: by 10.192.165.156 with SMTP id m28csp212064imm; Sun, 15 Apr 2018 21:19:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xqFWHUme6THOxBt+1+IgCoB8OXxn6y7qvhAtlNrYaxNqZSabGR/pHuH1zcF0iKM/t7vtP X-Received: by 10.101.71.138 with SMTP id e10mr11086041pgs.47.1523852381047; Sun, 15 Apr 2018 21:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523852381; cv=none; d=google.com; s=arc-20160816; b=mNmv9+TyKgxUR9a96GS9FtbTnJduI1YqBGltIYU6uXgPNIrCafdvD92u/U4vg/wu95 Y6I+uFNeJbjM/Gz1Xdr9dYHZlogGBpFX1TPpp5Uqee0lVIWCr7u/IvCxL8dcuse/Ixpt I6Tx7G7jSAIdeo8GPOicq5GB0KBXyurdRo0gSBu295/Y7k9K+ojbCRcePrPtBdZOJlXf 0gJf/dwaOX5YOKzisnw23p2BE56j15DMAP76TS0GRFJb+Xx/yD9YkwCOOAmreIF7BMY3 ij6npxIzOv8yE3+/2aqYOSC5WfjYzgklhH+EyObXFo09uw+FiuZv7p6FsgHghmw6nWud 49ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=BAgJ4AJJF3QC7uDWTndQoglF/xUrLOCA+dufALhRysw=; b=t1gYp8o7+SOTVWyTUnYXFeSLe6VyVBwDDZ0YgEM0rZFSyjtn+paiBtdGeuW7ZUqfE1 mIH+tQsMROK+L1iScWq0vAHO08ABKv/HKqhyCF8UQEKiBZykuMLOXYPyU7xavf12tcyE RZWMzFjNtOGR7CNZ0jl+gG6KGMUa+L9+Zb51oJ6qCxS/DlEL/5j/S9aCwV+gV3QqzGhW RMdadjVkvbLb5t2xQfs2SZUe9iLsaRcoURA5hUH6rUW80OKATNZ+oyfrv2hcjEZvJzfy OaRuQb2yjoZAKCeS78qQLhw+1377pqGUVq1YGa200GBHVfYH3m0i7mCsBSFnoyamf5FR ImQw== 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 j63si1849178pfc.351.2018.04.15.21.19.27; Sun, 15 Apr 2018 21:19:41 -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 S1753982AbeDPERw (ORCPT + 99 others); Mon, 16 Apr 2018 00:17:52 -0400 Received: from smtp4.ccs.ornl.gov ([160.91.203.40]:35548 "EHLO smtp4.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753729AbeDPEPY (ORCPT ); Mon, 16 Apr 2018 00:15:24 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id CE1EE1005198; Mon, 16 Apr 2018 00:15:12 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id C9EF41F3; Mon, 16 Apr 2018 00:15:12 -0400 (EDT) From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , NeilBrown Cc: Linux Kernel Mailing List , Lustre Development List , Bobi Jam , James Simmons Subject: [PATCH 11/22] staging: lustre: llite: eat -EEXIST on setting trusted.lov Date: Mon, 16 Apr 2018 00:15:00 -0400 Message-Id: <1523852111-17321-12-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523852111-17321-1-git-send-email-jsimmons@infradead.org> References: <1523852111-17321-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bobi Jam Tools like rsync, tar, cp may copy and restore the xattrs on a file. The client previously ignored the setting of trusted.lov/lustre.lov if the layout had already been specified, to avoid causing these tools to fail for no reason. For PFL files we still need to silently eat -EEXIST on setting these attributes to avoid problems. Signed-off-by: Bobi Jam Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484 Reviewed-on: https://review.whamcloud.com/27126 Reviewed-by: Dmitry Eremin Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 56ac07e..69c5227 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -254,12 +254,20 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, lum_size = ll_lov_user_md_size(lump); if (lum_size < 0 || size < lum_size) - return 0; /* b=10667: ignore error */ + return -ERANGE; rc = ll_lov_setstripe_ea_info(inode, dentry, it_flags, lump, lum_size); - /* b=10667: rc always be 0 here for now */ - rc = 0; + /** + * b=10667: ignore -EEXIST. + * Silently eat error on setting trusted.lov/lustre.lov + * attribute for platforms that added the default option + * to copy all attributes in 'cp' command. Both rsync and + * tar --xattrs also will try to set LOVEA for existing + * files. + */ + if (rc == -EEXIST) + rc = 0; } else if (S_ISDIR(inode->i_mode)) { rc = ll_dir_setstripe(inode, lump, 0); } -- 1.8.3.1