Commit a531a141 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  ocfs2: reverse inline-data truncate args
  ocfs2: Fix comparison in ocfs2_size_fits_inline_data()
  ocfs2: Remove bug statement in ocfs2_dentry_iput()
  [PATCH] ocfs2: Remove expensive bitmap scanning
  ocfs2: log valid inode # on bad inode
  ocfs2: Filter -ENOSPC in mlog_errno()
  [PATCH] fs/ocfs2: Add missing "space"
  ocfs2: Reset journal parameters after s_mount_opt update
parents 5e6ddf9a b1967d0e
......@@ -459,6 +459,15 @@ config OCFS2_DEBUG_MASKLOG
This option will enlarge your kernel, but it allows debugging of
ocfs2 filesystem issues.
config OCFS2_DEBUG_FS
bool "OCFS2 expensive checks"
depends on OCFS2_FS
default n
help
This option will enable expensive consistency checks. Enable
this option for debugging only as it is likely to decrease
performance of the filesystem.
config MINIX_FS
tristate "Minix fs support"
help
......
......@@ -1514,7 +1514,7 @@ int ocfs2_size_fits_inline_data(struct buffer_head *di_bh, u64 new_size)
{
struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
if (new_size < le16_to_cpu(di->id2.i_data.id_count))
if (new_size <= le16_to_cpu(di->id2.i_data.id_count))
return 1;
return 0;
}
......
......@@ -212,7 +212,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
#define mlog_errno(st) do { \
int _st = (st); \
if (_st != -ERESTARTSYS && _st != -EINTR && \
_st != AOP_TRUNCATED_PAGE) \
_st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
} while (0)
......
......@@ -344,12 +344,24 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode)
{
struct ocfs2_dentry_lock *dl = dentry->d_fsdata;
mlog_bug_on_msg(!dl && !(dentry->d_flags & DCACHE_DISCONNECTED),
"dentry: %.*s\n", dentry->d_name.len,
dentry->d_name.name);
if (!dl) {
/*
* No dentry lock is ok if we're disconnected or
* unhashed.
*/
if (!(dentry->d_flags & DCACHE_DISCONNECTED) &&
!d_unhashed(dentry)) {
unsigned long long ino = 0ULL;
if (inode)
ino = (unsigned long long)OCFS2_I(inode)->ip_blkno;
mlog(ML_ERROR, "Dentry is missing cluster lock. "
"inode: %llu, d_flags: 0x%x, d_name: %.*s\n",
ino, dentry->d_flags, dentry->d_name.len,
dentry->d_name.name);
}
if (!dl)
goto out;
}
mlog_bug_on_msg(dl->dl_count == 0, "dentry: %.*s, count: %u\n",
dentry->d_name.len, dentry->d_name.name,
......
......@@ -908,7 +908,7 @@ lookup:
* but they might own this lockres. wait on them. */
bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0);
if (bit < O2NM_MAX_NODES) {
mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to"
mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to "
"recover before lock mastery can begin\n",
dlm->name, namelen, (char *)lockid, bit);
wait_on_recovery = 1;
......@@ -962,7 +962,7 @@ redo_request:
spin_lock(&dlm->spinlock);
bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0);
if (bit < O2NM_MAX_NODES) {
mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to"
mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to "
"recover before lock mastery can begin\n",
dlm->name, namelen, (char *)lockid, bit);
wait_on_recovery = 1;
......
......@@ -399,7 +399,7 @@ static int ocfs2_truncate_file(struct inode *inode,
if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
status = ocfs2_truncate_inline(inode, di_bh, new_i_size,
i_size_read(inode), 0);
i_size_read(inode), 1);
if (status)
mlog_errno(status);
......@@ -1521,6 +1521,7 @@ static int ocfs2_remove_inode_range(struct inode *inode,
u32 trunc_start, trunc_len, cpos, phys_cpos, alloc_size;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_cached_dealloc_ctxt dealloc;
struct address_space *mapping = inode->i_mapping;
ocfs2_init_dealloc_ctxt(&dealloc);
......@@ -1529,10 +1530,20 @@ static int ocfs2_remove_inode_range(struct inode *inode,
if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
ret = ocfs2_truncate_inline(inode, di_bh, byte_start,
byte_start + byte_len, 1);
if (ret)
byte_start + byte_len, 0);
if (ret) {
mlog_errno(ret);
return ret;
goto out;
}
/*
* There's no need to get fancy with the page cache
* truncate of an inline-data inode. We're talking
* about less than a page here, which will be cached
* in the dinode buffer anyway.
*/
unmap_mapping_range(mapping, 0, 0, 0);
truncate_inode_pages(mapping, 0);
goto out;
}
trunc_start = ocfs2_clusters_for_bytes(osb->sb, byte_start);
......
......@@ -455,8 +455,8 @@ static int ocfs2_read_locked_inode(struct inode *inode,
status = -EINVAL;
fe = (struct ocfs2_dinode *) bh->b_data;
if (!OCFS2_IS_VALID_DINODE(fe)) {
mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n",
(unsigned long long)le64_to_cpu(fe->i_blkno), 7,
mlog(0, "Invalid dinode #%llu: signature = %.*s\n",
(unsigned long long)args->fi_blkno, 7,
fe->i_signature);
goto bail;
}
......@@ -863,7 +863,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
status = ocfs2_try_open_lock(inode, 1);
if (status == -EAGAIN) {
status = 0;
mlog(0, "Skipping delete of %llu because it is in use on"
mlog(0, "Skipping delete of %llu because it is in use on "
"other nodes\n", (unsigned long long)oi->ip_blkno);
goto bail;
}
......
......@@ -484,6 +484,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
#ifdef OCFS2_DEBUG_FS
if (le32_to_cpu(alloc->id1.bitmap1.i_used) !=
ocfs2_local_alloc_count_bits(alloc)) {
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,
status = -EIO;
goto bail;
}
#endif
free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) -
le32_to_cpu(alloc->id1.bitmap1.i_used);
......@@ -712,9 +714,8 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb,
void *bitmap;
struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
mlog_entry("total = %u, COUNT = %u, used = %u\n",
mlog_entry("total = %u, used = %u\n",
le32_to_cpu(alloc->id1.bitmap1.i_total),
ocfs2_local_alloc_count_bits(alloc),
le32_to_cpu(alloc->id1.bitmap1.i_used));
if (!alloc->id1.bitmap1.i_total) {
......
......@@ -438,14 +438,14 @@ unlock_osb:
}
if (!ret) {
if (!ocfs2_is_hard_readonly(osb))
ocfs2_set_journal_params(osb);
/* Only save off the new mount options in case of a successful
* remount. */
osb->s_mount_opt = parsed_options.mount_opt;
osb->s_atime_quantum = parsed_options.atime_quantum;
osb->preferred_slot = parsed_options.slot;
if (!ocfs2_is_hard_readonly(osb))
ocfs2_set_journal_params(osb);
}
out:
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment