summaryrefslogtreecommitdiffstats
path: root/module/zfs/zpl_xattr.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-07-15 13:29:57 -0700
committerBrian Behlendorf <[email protected]>2014-07-17 15:15:07 -0700
commit1e8db7710220332808920a582e5794d6fc37b109 (patch)
tree5480855f5bc841e32703bc7cf4f0835b212f3077 /module/zfs/zpl_xattr.c
parenta5778ea2427bd340e3b4f697d9b6e1452bd71909 (diff)
Fix zil_commit() NULL dereference
Update the current code to ensure inodes are never dirtied if they are part of a read-only file system or snapshot. If they do somehow get dirtied an attempt will make made to write them to disk. In the case of snapshots, which don't have a ZIL, this will result in a NULL dereference in zil_commit(). Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2405
Diffstat (limited to 'module/zfs/zpl_xattr.c')
-rw-r--r--module/zfs/zpl_xattr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
index c5c15a2dd..107b80300 100644
--- a/module/zfs/zpl_xattr.c
+++ b/module/zfs/zpl_xattr.c
@@ -751,7 +751,7 @@ zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl)
if (ip->i_mode != mode) {
ip->i_mode = mode;
ip->i_ctime = current_fs_time(sb);
- mark_inode_dirty(ip);
+ zfs_mark_inode_dirty(ip);
}
if (error == 0)
@@ -909,7 +909,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
if (!acl) {
ip->i_mode &= ~current_umask();
ip->i_ctime = current_fs_time(ITOZSB(ip)->z_sb);
- mark_inode_dirty(ip);
+ zfs_mark_inode_dirty(ip);
return (0);
}
}
@@ -927,7 +927,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
error = __posix_acl_create(&acl, GFP_KERNEL, &mode);
if (error >= 0) {
ip->i_mode = mode;
- mark_inode_dirty(ip);
+ zfs_mark_inode_dirty(ip);
if (error > 0)
error = zpl_set_acl(ip, ACL_TYPE_ACCESS, acl);
}