diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-04-06 22:01:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-07 11:31:19 -0400 |
commit | 1f5abe7e7dbcd83e73212c6cb135a6106cea6a0b (patch) | |
tree | f80e97297d5badebd31bbb17003d76a4ea30453a /fs/nilfs2/super.c | |
parent | 2c2e52fc4fca251e68f90821c9ff5cb18be4df58 (diff) |
nilfs2: replace BUG_ON and BUG calls triggerable from ioctl
Pekka Enberg advised me:
> It would be nice if BUG(), BUG_ON(), and panic() calls would be
> converted to proper error handling using WARN_ON() calls. The BUG()
> call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
> triggerable from user-space via the ioctl() system call.
This will follow the comment and keep them to a minimum.
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 2f0e9f7bf152..d0639a6aae9e 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -841,8 +841,11 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent, | |||
841 | 841 | ||
842 | if (sb->s_flags & MS_RDONLY) { | 842 | if (sb->s_flags & MS_RDONLY) { |
843 | if (nilfs_test_opt(sbi, SNAPSHOT)) { | 843 | if (nilfs_test_opt(sbi, SNAPSHOT)) { |
844 | if (!nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, | 844 | err = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, |
845 | sbi->s_snapshot_cno)) { | 845 | sbi->s_snapshot_cno); |
846 | if (err < 0) | ||
847 | goto failed_sbi; | ||
848 | if (!err) { | ||
846 | printk(KERN_ERR | 849 | printk(KERN_ERR |
847 | "NILFS: The specified checkpoint is " | 850 | "NILFS: The specified checkpoint is " |
848 | "not a snapshot " | 851 | "not a snapshot " |
@@ -1163,7 +1166,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags, | |||
1163 | } else { | 1166 | } else { |
1164 | struct nilfs_sb_info *sbi = NILFS_SB(s); | 1167 | struct nilfs_sb_info *sbi = NILFS_SB(s); |
1165 | 1168 | ||
1166 | BUG_ON(!sbi || !sbi->s_nilfs); | ||
1167 | /* | 1169 | /* |
1168 | * s_umount protects super_block from unmount process; | 1170 | * s_umount protects super_block from unmount process; |
1169 | * It covers pointers of nilfs_sb_info and the_nilfs. | 1171 | * It covers pointers of nilfs_sb_info and the_nilfs. |