summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMilosz Tanski <milosz@adfin.com>2013-09-05 18:29:03 +0000
committerMilosz Tanski <milosz@adfin.com>2013-09-06 16:50:12 +0000
commite81568eb1819af1391ac27ab28ac851410315a9f (patch)
tree1131da4ce41231d7f2563519ec24cef7fd18657f /fs
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')
-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:
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,