diff options
author | luozhengzheng <[email protected]> | 2016-10-19 02:32:59 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-10-18 11:32:59 -0700 |
commit | 7c502b0b1de8d3d341c026760df5915ad4be794a (patch) | |
tree | f554c718ed180fdb02222d18c076e79116f4451e | |
parent | 6d00b5e13699c946a3f78c73defe5ff1e18264a3 (diff) |
Fix coverity defects: CID 150926
CID 150926: Unchecked return value (CHECKED_RETURN)
- This case cannot occur given the existing taskq implementation
and flags passed to task_dispatch().
Reviewed-by: Chunwei Chen <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: luozhengzheng <[email protected]>
Closes #5272
-rw-r--r-- | module/zfs/zfs_vnops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 887b7e1dd..116bb2730 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -932,6 +932,12 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) } EXPORT_SYMBOL(zfs_write); +/* + * Drop a reference on the passed inode asynchronously. This ensures + * that the caller will never drop the last reference on an inode in + * the current context. Doing so while holding open a tx could result + * in a deadlock if iput_final() re-enters the filesystem code. + */ void zfs_iput_async(struct inode *ip) { @@ -941,8 +947,8 @@ zfs_iput_async(struct inode *ip) ASSERT(os != NULL); if (atomic_read(&ip->i_count) == 1) - taskq_dispatch(dsl_pool_iput_taskq(dmu_objset_pool(os)), - (task_func_t *)iput, ip, TQ_SLEEP); + VERIFY(taskq_dispatch(dsl_pool_iput_taskq(dmu_objset_pool(os)), + (task_func_t *)iput, ip, TQ_SLEEP) != 0); else iput(ip); } |