From: Milosz Tanski Date: Thu, 5 Sep 2013 18:29:03 +0000 (+0000) Subject: ceph: Do not do invalidate if the filesystem is mounted nofsc X-Git-Tag: v3.12-rc2~16^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e81568eb1819af1391ac27ab28ac851410315a9f;p=kernel%2Fkernel-generic.git ceph: Do not do invalidate if the filesystem is mounted nofsc Previously we would always try to enqueue work even if the filesystem is not mounted with fscache enabled (or the file has no cookie). In the case of the filesystem mouned nofsc (but with fscache compiled in) this would lead to a crash. Signed-off-by: Milosz Tanski --- diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index c737ae9..d3b88c7 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c @@ -374,8 +374,12 @@ out: void ceph_queue_revalidate(struct inode *inode) { + struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); struct ceph_inode_info *ci = ceph_inode(inode); + if (fsc->revalidate_wq == NULL || ci->fscache == NULL) + return; + ihold(inode); if (queue_work(ceph_sb_to_client(inode->i_sb)->revalidate_wq,