diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-17 21:35:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-17 21:35:39 -0400 |
commit | 351f13d7087d4f633552d0e5491adf049fc9276c (patch) | |
tree | d17e71e91b78c9543a6e4641bd7cb920e0cb63fc /fs | |
parent | e14f64c2079240082f3c5bf98d9ecf3dc6780338 (diff) | |
parent | ea1a16f7168ac19d974ac51b47593b92280e7992 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
nilfs2: fix false warning saying one of two super blocks is broken
nilfs2: fix list corruption after ifile creation failure
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nilfs2/super.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/the_nilfs.c | 4 |
2 files changed, 5 insertions, 3 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); |
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 37de1f062d81..6af1c0073e9e 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c | |||
@@ -608,11 +608,11 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs, | |||
608 | return -EINVAL; | 608 | return -EINVAL; |
609 | } | 609 | } |
610 | 610 | ||
611 | if (swp) { | 611 | if (!valid[!swp]) |
612 | printk(KERN_WARNING "NILFS warning: broken superblock. " | 612 | printk(KERN_WARNING "NILFS warning: broken superblock. " |
613 | "using spare superblock.\n"); | 613 | "using spare superblock.\n"); |
614 | if (swp) | ||
614 | nilfs_swap_super_block(nilfs); | 615 | nilfs_swap_super_block(nilfs); |
615 | } | ||
616 | 616 | ||
617 | nilfs->ns_sbwcount = 0; | 617 | nilfs->ns_sbwcount = 0; |
618 | nilfs->ns_sbwtime = le64_to_cpu(sbp[0]->s_wtime); | 618 | nilfs->ns_sbwtime = le64_to_cpu(sbp[0]->s_wtime); |