diff options
author | Zhu Yanhai <zhu.yanhai@gmail.com> | 2009-08-12 08:17:59 +0200 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-09-14 11:27:14 +0200 |
commit | 43be0ec0387a5ccce2e064cb78502e7b2b4dd590 (patch) | |
tree | e412246fce3f999b46b960ef416f1f10653ca895 /fs/nilfs2/super.c | |
parent | nilfs2: An unassigned variable is assigned to a never used structure member (diff) | |
download | linux-43be0ec0387a5ccce2e064cb78502e7b2b4dd590.tar.xz linux-43be0ec0387a5ccce2e064cb78502e7b2b4dd590.zip |
nilfs2: add more check routines in mount process
nilfs2: Add more safeguard routines and protections in mount process,
which also makes nilfs2 report consistency error messages when
checkpoint number is invalid.
Signed-off-by: Zhu Yanhai <zhu.yanhai@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to '')
-rw-r--r-- | fs/nilfs2/super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 019752f7d2da..50284add7880 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -792,10 +792,15 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent, if (sb->s_flags & MS_RDONLY) { if (nilfs_test_opt(sbi, SNAPSHOT)) { + down_read(&nilfs->ns_segctor_sem); err = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, sbi->s_snapshot_cno); - if (err < 0) + up_read(&nilfs->ns_segctor_sem); + if (err < 0) { + if (err == -ENOENT) + err = -EINVAL; goto failed_sbi; + } if (!err) { printk(KERN_ERR "NILFS: The specified checkpoint is " |