Skip to content

Commit

Permalink
ceph: Do not do invalidate if the filesystem is mounted nofsc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Milosz Tanski committed Sep 6, 2013
1 parent d4d3aa3 commit e81568e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ceph/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e81568e

Please sign in to comment.