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

Commit d572b879 authored by Dave Kleikamp's avatar Dave Kleikamp
Browse files

JFS: Remove redundant xattr permission checking



The vfs handles most permissions for setting and retrieving xattrs.
This patch removes a redundant and wrong check so that it won't override
the correct behavior which is being fixed in the vfs.

Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent 89f68225
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -756,6 +756,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
	return -EOPNOTSUPP;
}

/*
 * Most of the permission checking is done by xattr_permission in the vfs.
 * The local file system is responsible for handling the system.* namespace.
 * We also need to verify that this is a namespace that we recognize.
 */
static int can_set_xattr(struct inode *inode, const char *name,
			 const void *value, size_t value_len)
{
@@ -771,10 +776,6 @@ static int can_set_xattr(struct inode *inode, const char *name,
	    strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))
		return -EOPNOTSUPP;

	if (!S_ISREG(inode->i_mode) &&
	    (!S_ISDIR(inode->i_mode) || inode->i_mode &S_ISVTX))
		return -EPERM;

	return 0;
}