aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/the_nilfs.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-09-12 22:16:34 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-22 20:24:38 -0400
commit032dbb3b503a30fce732ec4c05525d0abed1f1d6 (patch)
tree462696abcf0783d50efe97a3ca2641beecc91a3e /fs/nilfs2/the_nilfs.c
parentf1e89c86fdd0f5e59f6768146c86437934202033 (diff)
nilfs2: see state of root dentry for mount check of snapshots
After applied the patch that unified sb instances, root dentry of snapshots can be left in dcache even after their trees are unmounted. The orphan root dentry/inode keeps a root object, and this causes false positive of nilfs_checkpoint_is_mounted function. This resolves the issue by having nilfs_checkpoint_is_mounted test whether the root dentry is busy or not. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/the_nilfs.c')
-rw-r--r--fs/nilfs2/the_nilfs.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
index 4d6763e28eb5..4cc705a1d135 100644
--- a/fs/nilfs2/the_nilfs.c
+++ b/fs/nilfs2/the_nilfs.c
@@ -769,24 +769,3 @@ void nilfs_put_root(struct nilfs_root *root)
769 kfree(root); 769 kfree(root);
770 } 770 }
771} 771}
772
773int nilfs_checkpoint_is_mounted(struct the_nilfs *nilfs, __u64 cno,
774 int snapshot_mount)
775{
776 struct nilfs_root *root;
777 int ret;
778
779 if (cno < 0 || cno > nilfs->ns_cno)
780 return false;
781
782 if (cno >= nilfs_last_cno(nilfs))
783 return true; /* protect recent checkpoints */
784
785 ret = false;
786 root = nilfs_lookup_root(nilfs, cno);
787 if (root) {
788 ret = true;
789 nilfs_put_root(root);
790 }
791 return ret;
792}