Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13050238 authored by Bobi Jam's avatar Bobi Jam Committed by Greg Kroah-Hartman
Browse files

staging: lustre: llite: eat -EEXIST on setting trusted.lov



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: default avatarBobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484
Reviewed-on: https://review.whamcloud.com/27126


Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarNiu Yawei <yawei.niu@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d095bc9f
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -254,11 +254,19 @@ 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 */
		/**
		 * 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);