aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c61
1 files changed, 39 insertions, 22 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 4e59a91a11e0..60e7179ed4b7 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -235,7 +235,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
235 trans->aborted = errno; 235 trans->aborted = errno;
236 /* Nothing used. The other threads that have joined this 236 /* Nothing used. The other threads that have joined this
237 * transaction may be able to continue. */ 237 * transaction may be able to continue. */
238 if (!trans->blocks_used && list_empty(&trans->new_bgs)) { 238 if (!trans->dirty && list_empty(&trans->new_bgs)) {
239 const char *errstr; 239 const char *errstr;
240 240
241 errstr = btrfs_decode_error(errno); 241 errstr = btrfs_decode_error(errno);
@@ -1807,6 +1807,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1807 } 1807 }
1808 } 1808 }
1809 sb->s_flags &= ~MS_RDONLY; 1809 sb->s_flags &= ~MS_RDONLY;
1810
1811 fs_info->open = 1;
1810 } 1812 }
1811out: 1813out:
1812 wake_up_process(fs_info->transaction_kthread); 1814 wake_up_process(fs_info->transaction_kthread);
@@ -2303,7 +2305,7 @@ static void btrfs_interface_exit(void)
2303 2305
2304static void btrfs_print_mod_info(void) 2306static void btrfs_print_mod_info(void)
2305{ 2307{
2306 printk(KERN_INFO "Btrfs loaded" 2308 printk(KERN_INFO "Btrfs loaded, crc32c=%s"
2307#ifdef CONFIG_BTRFS_DEBUG 2309#ifdef CONFIG_BTRFS_DEBUG
2308 ", debug=on" 2310 ", debug=on"
2309#endif 2311#endif
@@ -2313,33 +2315,48 @@ static void btrfs_print_mod_info(void)
2313#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 2315#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
2314 ", integrity-checker=on" 2316 ", integrity-checker=on"
2315#endif 2317#endif
2316 "\n"); 2318 "\n",
2319 btrfs_crc32c_impl());
2317} 2320}
2318 2321
2319static int btrfs_run_sanity_tests(void) 2322static int btrfs_run_sanity_tests(void)
2320{ 2323{
2321 int ret; 2324 int ret, i;
2322 2325 u32 sectorsize, nodesize;
2326 u32 test_sectorsize[] = {
2327 PAGE_SIZE,
2328 };
2323 ret = btrfs_init_test_fs(); 2329 ret = btrfs_init_test_fs();
2324 if (ret) 2330 if (ret)
2325 return ret; 2331 return ret;
2326 2332 for (i = 0; i < ARRAY_SIZE(test_sectorsize); i++) {
2327 ret = btrfs_test_free_space_cache(); 2333 sectorsize = test_sectorsize[i];
2328 if (ret) 2334 for (nodesize = sectorsize;
2329 goto out; 2335 nodesize <= BTRFS_MAX_METADATA_BLOCKSIZE;
2330 ret = btrfs_test_extent_buffer_operations(); 2336 nodesize <<= 1) {
2331 if (ret) 2337 pr_info("BTRFS: selftest: sectorsize: %u nodesize: %u\n",
2332 goto out; 2338 sectorsize, nodesize);
2333 ret = btrfs_test_extent_io(); 2339 ret = btrfs_test_free_space_cache(sectorsize, nodesize);
2334 if (ret) 2340 if (ret)
2335 goto out; 2341 goto out;
2336 ret = btrfs_test_inodes(); 2342 ret = btrfs_test_extent_buffer_operations(sectorsize,
2337 if (ret) 2343 nodesize);
2338 goto out; 2344 if (ret)
2339 ret = btrfs_test_qgroups(); 2345 goto out;
2340 if (ret) 2346 ret = btrfs_test_extent_io(sectorsize, nodesize);
2341 goto out; 2347 if (ret)
2342 ret = btrfs_test_free_space_tree(); 2348 goto out;
2349 ret = btrfs_test_inodes(sectorsize, nodesize);
2350 if (ret)
2351 goto out;
2352 ret = btrfs_test_qgroups(sectorsize, nodesize);
2353 if (ret)
2354 goto out;
2355 ret = btrfs_test_free_space_tree(sectorsize, nodesize);
2356 if (ret)
2357 goto out;
2358 }
2359 }
2343out: 2360out:
2344 btrfs_destroy_test_fs(); 2361 btrfs_destroy_test_fs();
2345 return ret; 2362 return ret;