Whamcloud - gitweb
LU-8682 llite: protect from accessing NULL lli_clob 31/23031/3
authorBobi Jam <bobijam.xu@intel.com>
Tue, 27 Oct 2015 13:17:41 +0000 (21:17 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 20 Oct 2016 10:40:44 +0000 (10:40 +0000)
Need to check file's lli_clob object before calling
lov_read_and_clear_async_rc().

lustre-change: http://review.whamcloud.com/16954
lustre-commit: 4e416d205b0d04e291e0f279741af85fa73845d2

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: LDEV-231
Change-Id: I210b22d4e17dd4a407378aa987434d1940799f1f
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/23031
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/llite/file.c

index 740e199..20c8a24 100644 (file)
@@ -2955,9 +2955,11 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
                lli->lli_async_rc = 0;
                if (rc == 0)
                        rc = err;
-               err = lov_read_and_clear_async_rc(lli->lli_clob);
-               if (rc == 0)
-                       rc = err;
+               if (lli->lli_clob != NULL) {
+                       err = lov_read_and_clear_async_rc(lli->lli_clob);
+                       if (rc == 0)
+                               rc = err;
+               }
        }
 
        err = md_fsync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);