]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ceph: Do not do invalidate if the filesystem is mounted nofsc
authorMilosz Tanski <milosz@adfin.com>
Thu, 5 Sep 2013 18:29:03 +0000 (18:29 +0000)
committerMilosz Tanski <milosz@adfin.com>
Fri, 6 Sep 2013 16:50:12 +0000 (16:50 +0000)
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 <milosz@adfin.com>
fs/ceph/cache.c

index c737ae9893efa7d92b6cbb066080e651cbc07712..d3b88c7518d02677760a56f696263b69d3a4c69a 100644 (file)
@@ -374,8 +374,12 @@ static void ceph_revalidate_work(struct work_struct *work)
 
 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,