diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nilfs2/super.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 1fa86b9df73b..bee60c04109a 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -400,9 +400,10 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno) | |||
400 | list_add(&sbi->s_list, &nilfs->ns_supers); | 400 | list_add(&sbi->s_list, &nilfs->ns_supers); |
401 | up_write(&nilfs->ns_super_sem); | 401 | up_write(&nilfs->ns_super_sem); |
402 | 402 | ||
403 | err = -ENOMEM; | ||
403 | sbi->s_ifile = nilfs_ifile_new(sbi, nilfs->ns_inode_size); | 404 | sbi->s_ifile = nilfs_ifile_new(sbi, nilfs->ns_inode_size); |
404 | if (!sbi->s_ifile) | 405 | if (!sbi->s_ifile) |
405 | return -ENOMEM; | 406 | goto delist; |
406 | 407 | ||
407 | down_read(&nilfs->ns_segctor_sem); | 408 | down_read(&nilfs->ns_segctor_sem); |
408 | err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, | 409 | err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, |
@@ -433,6 +434,7 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno) | |||
433 | nilfs_mdt_destroy(sbi->s_ifile); | 434 | nilfs_mdt_destroy(sbi->s_ifile); |
434 | sbi->s_ifile = NULL; | 435 | sbi->s_ifile = NULL; |
435 | 436 | ||
437 | delist: | ||
436 | down_write(&nilfs->ns_super_sem); | 438 | down_write(&nilfs->ns_super_sem); |
437 | list_del_init(&sbi->s_list); | 439 | list_del_init(&sbi->s_list); |
438 | up_write(&nilfs->ns_super_sem); | 440 | up_write(&nilfs->ns_super_sem); |