]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix coverity defects: CID 150926
authorluozhengzheng <luo.zhengzheng@zte.com.cn>
Tue, 18 Oct 2016 18:32:59 +0000 (02:32 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 18 Oct 2016 18:32:59 +0000 (11:32 -0700)
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 <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5272

module/zfs/zfs_vnops.c

index 887b7e1dde857408778afe41922c0d144a866c77..116bb2730ff0b781368beb428d64c94b7ad9f7f1 100644 (file)
@@ -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);
 }