if (err)
return err;
- err = vfs_setxattr(dentry, ovl_whiteout_xattr, "y", 1, 0);
+ err = ovl_do_setxattr(dentry, ovl_whiteout_xattr, "y", 1, 0);
if (err)
vfs_unlink(workdir, dentry, NULL);
static inline int ovl_do_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags)
{
- int err = vfs_setxattr(dentry, name, value, size, flags);
+ struct inode *inode = dentry->d_inode;
+ int err = -EOPNOTSUPP;
+
+ mutex_lock(&inode->i_mutex);
+ if (inode->i_op->setxattr)
+ err = inode->i_op->setxattr(dentry, name, value, size, flags);
+ mutex_unlock(&inode->i_mutex);
+
pr_debug("setxattr(%pd2, \"%s\", \"%*s\", 0x%x) = %i\n",
dentry, name, (int) size, (char *) value, flags, err);
return err;
static inline int ovl_do_removexattr(struct dentry *dentry, const char *name)
{
- int err = vfs_removexattr(dentry, name);
+ struct inode *inode = dentry->d_inode;
+ int err = -EOPNOTSUPP;
+
+ mutex_lock(&inode->i_mutex);
+ if (inode->i_op->removexattr)
+ err = inode->i_op->removexattr(dentry, name);
+ mutex_unlock(&inode->i_mutex);
+
pr_debug("removexattr(%pd2, \"%s\") = %i\n", dentry, name, err);
return err;
}