From: Bobi Jam Date: Tue, 27 Oct 2015 13:17:41 +0000 (+0800) Subject: LU-8682 llite: protect from accessing NULL lli_clob X-Git-Tag: 2.8.60~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F23031%2F3;p=fs%2Flustre-release.git LU-8682 llite: protect from accessing NULL lli_clob 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 Intel-bug-id: LDEV-231 Change-Id: I210b22d4e17dd4a407378aa987434d1940799f1f Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/23031 Tested-by: Jenkins Tested-by: Maloo --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 740e199..20c8a24 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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);