From e814770f2ed14808c7ea8cf8cea034aacb20564a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 13 May 2011 08:16:10 -0700 Subject: [PATCH] Update synchronous open zfs_close() comment The comment in zfs_close() pertaining to decrementing the synchronous open count needs to be updated for Linux. The code was already updated to be correct, but the comment was missed and is now misleading. Under Linux the zfs_close() hook is only called once when the final reference is dropped. This differs from Solaris where zfs_close() is called for each close. Closes #237 --- module/zfs/zfs_vnops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 107211f..5b47cba 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -220,7 +220,11 @@ zfs_close(struct inode *ip, int flag, cred_t *cr) ZFS_ENTER(zsb); ZFS_VERIFY_ZP(zp); - /* Decrement the synchronous opens in the znode */ + /* + * Zero the synchronous opens in the znode. Under Linux the + * zfs_close() hook is not symmetric with zfs_open(), it is + * only called once when the last reference is dropped. + */ if (flag & O_SYNC) zp->z_sync_cnt = 0; -- 1.8.3.1