diff options
-rw-r--r-- | fs/Kconfig | 9 | ||||
-rw-r--r-- | fs/ocfs2/aops.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/masklog.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/dcache.c | 20 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 19 | ||||
-rw-r--r-- | fs/ocfs2/inode.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 6 |
9 files changed, 53 insertions, 20 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index 429a00228507..635f3e286ad8 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -459,6 +459,15 @@ config OCFS2_DEBUG_MASKLOG | |||
459 | This option will enlarge your kernel, but it allows debugging of | 459 | This option will enlarge your kernel, but it allows debugging of |
460 | ocfs2 filesystem issues. | 460 | ocfs2 filesystem issues. |
461 | 461 | ||
462 | config OCFS2_DEBUG_FS | ||
463 | bool "OCFS2 expensive checks" | ||
464 | depends on OCFS2_FS | ||
465 | default n | ||
466 | help | ||
467 | This option will enable expensive consistency checks. Enable | ||
468 | this option for debugging only as it is likely to decrease | ||
469 | performance of the filesystem. | ||
470 | |||
462 | config MINIX_FS | 471 | config MINIX_FS |
463 | tristate "Minix fs support" | 472 | tristate "Minix fs support" |
464 | help | 473 | help |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 556e34ccb005..56f7790cad46 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -1514,7 +1514,7 @@ int ocfs2_size_fits_inline_data(struct buffer_head *di_bh, u64 new_size) | |||
1514 | { | 1514 | { |
1515 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; | 1515 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
1516 | 1516 | ||
1517 | if (new_size < le16_to_cpu(di->id2.i_data.id_count)) | 1517 | if (new_size <= le16_to_cpu(di->id2.i_data.id_count)) |
1518 | return 1; | 1518 | return 1; |
1519 | return 0; | 1519 | return 0; |
1520 | } | 1520 | } |
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h index cd046060114e..597e064bb94f 100644 --- a/fs/ocfs2/cluster/masklog.h +++ b/fs/ocfs2/cluster/masklog.h | |||
@@ -212,7 +212,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits; | |||
212 | #define mlog_errno(st) do { \ | 212 | #define mlog_errno(st) do { \ |
213 | int _st = (st); \ | 213 | int _st = (st); \ |
214 | if (_st != -ERESTARTSYS && _st != -EINTR && \ | 214 | if (_st != -ERESTARTSYS && _st != -EINTR && \ |
215 | _st != AOP_TRUNCATED_PAGE) \ | 215 | _st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \ |
216 | mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ | 216 | mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ |
217 | } while (0) | 217 | } while (0) |
218 | 218 | ||
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 1957a5ed219e..9923278ea6d4 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c | |||
@@ -344,12 +344,24 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode) | |||
344 | { | 344 | { |
345 | struct ocfs2_dentry_lock *dl = dentry->d_fsdata; | 345 | struct ocfs2_dentry_lock *dl = dentry->d_fsdata; |
346 | 346 | ||
347 | mlog_bug_on_msg(!dl && !(dentry->d_flags & DCACHE_DISCONNECTED), | 347 | if (!dl) { |
348 | "dentry: %.*s\n", dentry->d_name.len, | 348 | /* |
349 | dentry->d_name.name); | 349 | * No dentry lock is ok if we're disconnected or |
350 | * unhashed. | ||
351 | */ | ||
352 | if (!(dentry->d_flags & DCACHE_DISCONNECTED) && | ||
353 | !d_unhashed(dentry)) { | ||
354 | unsigned long long ino = 0ULL; | ||
355 | if (inode) | ||
356 | ino = (unsigned long long)OCFS2_I(inode)->ip_blkno; | ||
357 | mlog(ML_ERROR, "Dentry is missing cluster lock. " | ||
358 | "inode: %llu, d_flags: 0x%x, d_name: %.*s\n", | ||
359 | ino, dentry->d_flags, dentry->d_name.len, | ||
360 | dentry->d_name.name); | ||
361 | } | ||
350 | 362 | ||
351 | if (!dl) | ||
352 | goto out; | 363 | goto out; |
364 | } | ||
353 | 365 | ||
354 | mlog_bug_on_msg(dl->dl_count == 0, "dentry: %.*s, count: %u\n", | 366 | mlog_bug_on_msg(dl->dl_count == 0, "dentry: %.*s, count: %u\n", |
355 | dentry->d_name.len, dentry->d_name.name, | 367 | dentry->d_name.len, dentry->d_name.name, |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 62e4a7daa286..a54d33d95ada 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -908,7 +908,7 @@ lookup: | |||
908 | * but they might own this lockres. wait on them. */ | 908 | * but they might own this lockres. wait on them. */ |
909 | bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); | 909 | bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); |
910 | if (bit < O2NM_MAX_NODES) { | 910 | if (bit < O2NM_MAX_NODES) { |
911 | mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to" | 911 | mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to " |
912 | "recover before lock mastery can begin\n", | 912 | "recover before lock mastery can begin\n", |
913 | dlm->name, namelen, (char *)lockid, bit); | 913 | dlm->name, namelen, (char *)lockid, bit); |
914 | wait_on_recovery = 1; | 914 | wait_on_recovery = 1; |
@@ -962,7 +962,7 @@ redo_request: | |||
962 | spin_lock(&dlm->spinlock); | 962 | spin_lock(&dlm->spinlock); |
963 | bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); | 963 | bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); |
964 | if (bit < O2NM_MAX_NODES) { | 964 | if (bit < O2NM_MAX_NODES) { |
965 | mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to" | 965 | mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to " |
966 | "recover before lock mastery can begin\n", | 966 | "recover before lock mastery can begin\n", |
967 | dlm->name, namelen, (char *)lockid, bit); | 967 | dlm->name, namelen, (char *)lockid, bit); |
968 | wait_on_recovery = 1; | 968 | wait_on_recovery = 1; |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index bbac7cd33e0b..b75b2e1f0e42 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -399,7 +399,7 @@ static int ocfs2_truncate_file(struct inode *inode, | |||
399 | 399 | ||
400 | if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { | 400 | if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { |
401 | status = ocfs2_truncate_inline(inode, di_bh, new_i_size, | 401 | status = ocfs2_truncate_inline(inode, di_bh, new_i_size, |
402 | i_size_read(inode), 0); | 402 | i_size_read(inode), 1); |
403 | if (status) | 403 | if (status) |
404 | mlog_errno(status); | 404 | mlog_errno(status); |
405 | 405 | ||
@@ -1521,6 +1521,7 @@ static int ocfs2_remove_inode_range(struct inode *inode, | |||
1521 | u32 trunc_start, trunc_len, cpos, phys_cpos, alloc_size; | 1521 | u32 trunc_start, trunc_len, cpos, phys_cpos, alloc_size; |
1522 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1522 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1523 | struct ocfs2_cached_dealloc_ctxt dealloc; | 1523 | struct ocfs2_cached_dealloc_ctxt dealloc; |
1524 | struct address_space *mapping = inode->i_mapping; | ||
1524 | 1525 | ||
1525 | ocfs2_init_dealloc_ctxt(&dealloc); | 1526 | ocfs2_init_dealloc_ctxt(&dealloc); |
1526 | 1527 | ||
@@ -1529,10 +1530,20 @@ static int ocfs2_remove_inode_range(struct inode *inode, | |||
1529 | 1530 | ||
1530 | if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { | 1531 | if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { |
1531 | ret = ocfs2_truncate_inline(inode, di_bh, byte_start, | 1532 | ret = ocfs2_truncate_inline(inode, di_bh, byte_start, |
1532 | byte_start + byte_len, 1); | 1533 | byte_start + byte_len, 0); |
1533 | if (ret) | 1534 | if (ret) { |
1534 | mlog_errno(ret); | 1535 | mlog_errno(ret); |
1535 | return ret; | 1536 | goto out; |
1537 | } | ||
1538 | /* | ||
1539 | * There's no need to get fancy with the page cache | ||
1540 | * truncate of an inline-data inode. We're talking | ||
1541 | * about less than a page here, which will be cached | ||
1542 | * in the dinode buffer anyway. | ||
1543 | */ | ||
1544 | unmap_mapping_range(mapping, 0, 0, 0); | ||
1545 | truncate_inode_pages(mapping, 0); | ||
1546 | goto out; | ||
1536 | } | 1547 | } |
1537 | 1548 | ||
1538 | trunc_start = ocfs2_clusters_for_bytes(osb->sb, byte_start); | 1549 | trunc_start = ocfs2_clusters_for_bytes(osb->sb, byte_start); |
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 1d5e0cb0fda1..ebb2bbe30f35 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -455,8 +455,8 @@ static int ocfs2_read_locked_inode(struct inode *inode, | |||
455 | status = -EINVAL; | 455 | status = -EINVAL; |
456 | fe = (struct ocfs2_dinode *) bh->b_data; | 456 | fe = (struct ocfs2_dinode *) bh->b_data; |
457 | if (!OCFS2_IS_VALID_DINODE(fe)) { | 457 | if (!OCFS2_IS_VALID_DINODE(fe)) { |
458 | mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n", | 458 | mlog(0, "Invalid dinode #%llu: signature = %.*s\n", |
459 | (unsigned long long)le64_to_cpu(fe->i_blkno), 7, | 459 | (unsigned long long)args->fi_blkno, 7, |
460 | fe->i_signature); | 460 | fe->i_signature); |
461 | goto bail; | 461 | goto bail; |
462 | } | 462 | } |
@@ -863,7 +863,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode, | |||
863 | status = ocfs2_try_open_lock(inode, 1); | 863 | status = ocfs2_try_open_lock(inode, 1); |
864 | if (status == -EAGAIN) { | 864 | if (status == -EAGAIN) { |
865 | status = 0; | 865 | status = 0; |
866 | mlog(0, "Skipping delete of %llu because it is in use on" | 866 | mlog(0, "Skipping delete of %llu because it is in use on " |
867 | "other nodes\n", (unsigned long long)oi->ip_blkno); | 867 | "other nodes\n", (unsigned long long)oi->ip_blkno); |
868 | goto bail; | 868 | goto bail; |
869 | } | 869 | } |
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index d272847d5a07..58ea88b5af36 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -484,6 +484,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, | |||
484 | 484 | ||
485 | alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; | 485 | alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; |
486 | 486 | ||
487 | #ifdef OCFS2_DEBUG_FS | ||
487 | if (le32_to_cpu(alloc->id1.bitmap1.i_used) != | 488 | if (le32_to_cpu(alloc->id1.bitmap1.i_used) != |
488 | ocfs2_local_alloc_count_bits(alloc)) { | 489 | ocfs2_local_alloc_count_bits(alloc)) { |
489 | ocfs2_error(osb->sb, "local alloc inode %llu says it has " | 490 | ocfs2_error(osb->sb, "local alloc inode %llu says it has " |
@@ -494,6 +495,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, | |||
494 | status = -EIO; | 495 | status = -EIO; |
495 | goto bail; | 496 | goto bail; |
496 | } | 497 | } |
498 | #endif | ||
497 | 499 | ||
498 | free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - | 500 | free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - |
499 | le32_to_cpu(alloc->id1.bitmap1.i_used); | 501 | le32_to_cpu(alloc->id1.bitmap1.i_used); |
@@ -712,9 +714,8 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb, | |||
712 | void *bitmap; | 714 | void *bitmap; |
713 | struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); | 715 | struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); |
714 | 716 | ||
715 | mlog_entry("total = %u, COUNT = %u, used = %u\n", | 717 | mlog_entry("total = %u, used = %u\n", |
716 | le32_to_cpu(alloc->id1.bitmap1.i_total), | 718 | le32_to_cpu(alloc->id1.bitmap1.i_total), |
717 | ocfs2_local_alloc_count_bits(alloc), | ||
718 | le32_to_cpu(alloc->id1.bitmap1.i_used)); | 719 | le32_to_cpu(alloc->id1.bitmap1.i_used)); |
719 | 720 | ||
720 | if (!alloc->id1.bitmap1.i_total) { | 721 | if (!alloc->id1.bitmap1.i_total) { |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index be562ac3e89c..5ee775420665 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -438,14 +438,14 @@ unlock_osb: | |||
438 | } | 438 | } |
439 | 439 | ||
440 | if (!ret) { | 440 | if (!ret) { |
441 | if (!ocfs2_is_hard_readonly(osb)) | ||
442 | ocfs2_set_journal_params(osb); | ||
443 | |||
444 | /* Only save off the new mount options in case of a successful | 441 | /* Only save off the new mount options in case of a successful |
445 | * remount. */ | 442 | * remount. */ |
446 | osb->s_mount_opt = parsed_options.mount_opt; | 443 | osb->s_mount_opt = parsed_options.mount_opt; |
447 | osb->s_atime_quantum = parsed_options.atime_quantum; | 444 | osb->s_atime_quantum = parsed_options.atime_quantum; |
448 | osb->preferred_slot = parsed_options.slot; | 445 | osb->preferred_slot = parsed_options.slot; |
446 | |||
447 | if (!ocfs2_is_hard_readonly(osb)) | ||
448 | ocfs2_set_journal_params(osb); | ||
449 | } | 449 | } |
450 | out: | 450 | out: |
451 | return ret; | 451 | return ret; |