+ ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously.patch added to -mm tree
Subject: + ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously.patch added to -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 10 Mar 2014 12:52:58 -0700
The patch titled
Subject: ocfs2: alloc_dinode counts and group bitmap should be update simultaneously
has been added to the -mm tree. Its filename is
ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Younger Liu <[email protected]>
Subject: ocfs2: alloc_dinode counts and group bitmap should be update simultaneously
Updating alloc_dinode counts in ocfs2_alloc_dinode_update_counts() and setting group bitmap in ocfs2_alloc_dinode_update_bitmap() have to be done simultaneously. Two cases are as follow:
(1) If ocfs2_alloc_dinode_update_counts() fails, there is no need to set group bitmap. This case has been considered.
(2) If ocfs2_alloc_dinode_update_bitmap() fails, alloc_dinode counts should be rolled back. Otherwise, some clusters would never be used. This case is not considered.
So, we combine two functions, and ensure simultaneity.
---
fs/ocfs2/move_extents.c | 11 -- fs/ocfs2/ocfs2_trace.h | 2 fs/ocfs2/suballoc.c | 155 +++++++++++++++----------------------- fs/ocfs2/suballoc.h | 21 +---- 4 files changed, 77 insertions(+), 112 deletions(-)
fs/ocfs2/move_extents.c renamed from fs/ocfs2/move_extents.c~ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously +4 -7
@@ -681,18 +681,15 @@ static int ocfs2_move_extent(struct ocfs } gd = (struct ocfs2_group_desc *)gd_bh->b_data; - ret =ocfs2_alloc_dinode_update_counts (gb_inode, handle, gb_bh, len, -le16_to_cpu (gd->bg_chain)); + ret =ocfs2_alloc_dinode_update_bitmap (handle, + gb_inode, gb_bh, gd, gb_bh, +le16_to_cpu (gd->bg_chain), + goal_bit, len);if (ret) {mlog_errno (ret); goto out_commit; } - ret =ocfs2_block_group_set_bits (handle, gb_inode, gd, gd_bh, - goal_bit, len); -if (ret) -mlog_errno (ret); -/* * Here we should write the new page out first if we are * in write-back mode.
fs/ocfs2/ocfs2_trace.h renamed from fs/ocfs2/ocfs2_trace.h~ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously +1 -1
@@ -788,7 +788,7 @@ DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_DEFINE_OCFS2_ULL_EVENT (ocfs2_reserve_new_inode_new_group); -DEFINE_OCFS2_UINT_UINT_EVENT (ocfs2_block_group_set_bits); +DEFINE_OCFS2_UINT_UINT_EVENT (ocfs2_alloc_dinode_update_bitmap); TRACE_EVENT(ocfs2_relink_block_group, TP_PROTO(unsigned long long i_blkno, unsigned int chain,
fs/ocfs2/suballoc.c renamed from fs/ocfs2/suballoc.c~ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously +64 -91
208 lines not on this page · raw message
fs/ocfs2/suballoc.h renamed from fs/ocfs2/suballoc.h~ocfs2-alloc_dinode-counts-and-group-bitmap-should-be-update-simultaneously +0 -12
@@ -85,19 +85,14 @@ int ocfs2_reserve_new_inode(struct ocfs2int ocfs2_reserve_clusters (struct ocfs2_super *osb,u32 bits_wanted,struct ocfs2_alloc_context **ac); - -int ocfs2_alloc_dinode_update_counts (struct inode *inode, -handle_t *handle, -struct buffer_head *di_bh, -u32 num_bits, -u16 chain); -int ocfs2_block_group_set_bits (handle_t *handle, -struct inode *alloc_inode, -struct ocfs2_group_desc *bg, -struct buffer_head *group_bh, -unsigned int bit_off, -unsigned int num_bits);