From 1e8db7710220332808920a582e5794d6fc37b109 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 15 Jul 2014 13:29:57 -0700 Subject: 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 Signed-off-by: Brian Behlendorf Closes #2405 --- include/sys/zfs_znode.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sys/zfs_znode.h') diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h index a0200684e..4bb8a7761 100644 --- a/include/sys/zfs_znode.h +++ b/include/sys/zfs_znode.h @@ -337,6 +337,7 @@ extern void zfs_znode_dmu_fini(znode_t *); extern int zfs_inode_alloc(struct super_block *, struct inode **ip); extern void zfs_inode_destroy(struct inode *); extern void zfs_inode_update(znode_t *); +extern void zfs_mark_inode_dirty(struct inode *); extern void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, znode_t *dzp, znode_t *zp, char *name, vsecattr_t *, zfs_fuid_info_t *, -- cgit v1.2.3