aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorMilosz Tanski <milosz@adfin.com>2013-09-05 14:29:03 -0400
committerMilosz Tanski <milosz@adfin.com>2013-09-06 12:50:12 -0400
commite81568eb1819af1391ac27ab28ac851410315a9f (patch)
tree1131da4ce41231d7f2563519ec24cef7fd18657f /fs/ceph
parentd4d3aa38d66d0313401534bff2e4647df0a6d538 (diff)
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 <milosz@adfin.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c
index c737ae9893ef..d3b88c7518d0 100644
--- a/fs/ceph/cache.c
+++ b/fs/ceph/cache.c
@@ -374,8 +374,12 @@ out:
374 374
375void ceph_queue_revalidate(struct inode *inode) 375void ceph_queue_revalidate(struct inode *inode)
376{ 376{
377 struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb);
377 struct ceph_inode_info *ci = ceph_inode(inode); 378 struct ceph_inode_info *ci = ceph_inode(inode);
378 379
380 if (fsc->revalidate_wq == NULL || ci->fscache == NULL)
381 return;
382
379 ihold(inode); 383 ihold(inode);
380 384
381 if (queue_work(ceph_sb_to_client(inode->i_sb)->revalidate_wq, 385 if (queue_work(ceph_sb_to_client(inode->i_sb)->revalidate_wq,