diff options
Diffstat (limited to 'fs/logfs/super.c')
-rw-r--r-- | fs/logfs/super.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/logfs/super.c b/fs/logfs/super.c index c66beab78dee..b60bfac3263c 100644 --- a/fs/logfs/super.c +++ b/fs/logfs/super.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | #include "logfs.h" | 12 | #include "logfs.h" |
13 | #include <linux/bio.h> | 13 | #include <linux/bio.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
15 | #include <linux/statfs.h> | 16 | #include <linux/statfs.h> |
16 | #include <linux/buffer_head.h> | 17 | #include <linux/buffer_head.h> |
@@ -277,7 +278,7 @@ static int logfs_recover_sb(struct super_block *sb) | |||
277 | } | 278 | } |
278 | if (valid0 && valid1 && ds_cmp(ds0, ds1)) { | 279 | if (valid0 && valid1 && ds_cmp(ds0, ds1)) { |
279 | printk(KERN_INFO"Superblocks don't match - fixing.\n"); | 280 | printk(KERN_INFO"Superblocks don't match - fixing.\n"); |
280 | return write_one_sb(sb, super->s_devops->find_last_sb); | 281 | return logfs_write_sb(sb); |
281 | } | 282 | } |
282 | /* If neither is valid now, something's wrong. Didn't we properly | 283 | /* If neither is valid now, something's wrong. Didn't we properly |
283 | * check them before?!? */ | 284 | * check them before?!? */ |
@@ -289,6 +290,10 @@ static int logfs_make_writeable(struct super_block *sb) | |||
289 | { | 290 | { |
290 | int err; | 291 | int err; |
291 | 292 | ||
293 | err = logfs_open_segfile(sb); | ||
294 | if (err) | ||
295 | return err; | ||
296 | |||
292 | /* Repair any broken superblock copies */ | 297 | /* Repair any broken superblock copies */ |
293 | err = logfs_recover_sb(sb); | 298 | err = logfs_recover_sb(sb); |
294 | if (err) | 299 | if (err) |
@@ -299,10 +304,6 @@ static int logfs_make_writeable(struct super_block *sb) | |||
299 | if (err) | 304 | if (err) |
300 | return err; | 305 | return err; |
301 | 306 | ||
302 | err = logfs_open_segfile(sb); | ||
303 | if (err) | ||
304 | return err; | ||
305 | |||
306 | /* Do one GC pass before any data gets dirtied */ | 307 | /* Do one GC pass before any data gets dirtied */ |
307 | logfs_gc_pass(sb); | 308 | logfs_gc_pass(sb); |
308 | 309 | ||
@@ -328,7 +329,7 @@ static int logfs_get_sb_final(struct super_block *sb, struct vfsmount *mnt) | |||
328 | 329 | ||
329 | sb->s_root = d_alloc_root(rootdir); | 330 | sb->s_root = d_alloc_root(rootdir); |
330 | if (!sb->s_root) | 331 | if (!sb->s_root) |
331 | goto fail; | 332 | goto fail2; |
332 | 333 | ||
333 | super->s_erase_page = alloc_pages(GFP_KERNEL, 0); | 334 | super->s_erase_page = alloc_pages(GFP_KERNEL, 0); |
334 | if (!super->s_erase_page) | 335 | if (!super->s_erase_page) |
@@ -572,8 +573,7 @@ int logfs_get_sb_device(struct file_system_type *type, int flags, | |||
572 | return 0; | 573 | return 0; |
573 | 574 | ||
574 | err1: | 575 | err1: |
575 | up_write(&sb->s_umount); | 576 | deactivate_locked_super(sb); |
576 | deactivate_super(sb); | ||
577 | return err; | 577 | return err; |
578 | err0: | 578 | err0: |
579 | kfree(super); | 579 | kfree(super); |