summaryrefslogtreecommitdiffstats
path: root/module/zfs/zpl_xattr.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-04-14 10:25:50 -0700
committerBrian Behlendorf <[email protected]>2015-04-17 09:35:24 -0700
commit7fad6290eb3aefc9cbb6a64e4cbe5371af53f726 (patch)
tree581c48711eb0c635e9af2f14985302dca9142c9c /module/zfs/zpl_xattr.c
parentb467db454ea6507c4b9adf29c8083f860bfda2c1 (diff)
Mark additional functions as PF_FSTRANS
Prevent deadlocks by disabling direct reclaim during all NFS, xattr, ctldir, and super function calls. This is related to 40d06e3. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Issue #3225
Diffstat (limited to 'module/zfs/zpl_xattr.c')
-rw-r--r--module/zfs/zpl_xattr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
index 6a74b8190..202199c6d 100644
--- a/module/zfs/zpl_xattr.c
+++ b/module/zfs/zpl_xattr.c
@@ -209,9 +209,11 @@ zpl_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size)
zfs_sb_t *zsb = ZTOZSB(zp);
xattr_filldir_t xf = { buffer_size, 0, buffer, dentry->d_inode };
cred_t *cr = CRED();
+ fstrans_cookie_t cookie;
int error = 0;
crhold(cr);
+ cookie = spl_fstrans_mark();
rw_enter(&zp->z_xattr_lock, RW_READER);
if (zsb->z_use_sa && zp->z_is_sa) {
@@ -228,6 +230,7 @@ zpl_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size)
out:
rw_exit(&zp->z_xattr_lock);
+ spl_fstrans_unmark(cookie);
crfree(cr);
return (error);
@@ -337,12 +340,15 @@ zpl_xattr_get(struct inode *ip, const char *name, void *value, size_t size)
{
znode_t *zp = ITOZ(ip);
cred_t *cr = CRED();
+ fstrans_cookie_t cookie;
int error;
crhold(cr);
+ cookie = spl_fstrans_mark();
rw_enter(&zp->z_xattr_lock, RW_READER);
error = __zpl_xattr_get(ip, name, value, size, cr);
rw_exit(&zp->z_xattr_lock);
+ spl_fstrans_unmark(cookie);
crfree(cr);
return (error);
@@ -482,9 +488,11 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
znode_t *zp = ITOZ(ip);
zfs_sb_t *zsb = ZTOZSB(zp);
cred_t *cr = CRED();
+ fstrans_cookie_t cookie;
int error;
crhold(cr);
+ cookie = spl_fstrans_mark();
rw_enter(&ITOZ(ip)->z_xattr_lock, RW_WRITER);
/*
@@ -522,6 +530,7 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
error = zpl_xattr_set_dir(ip, name, value, size, flags, cr);
out:
rw_exit(&ITOZ(ip)->z_xattr_lock);
+ spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);