diff options
author | Younger Liu <younger.liucn@gmail.com> | 2014-04-03 17:47:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:20:56 -0400 |
commit | db66c71577d525c0cd65e66ff675747565783ba4 (patch) | |
tree | 94744927610c329533bad994055a37d2e2a3b5d1 /fs/ocfs2/suballoc.h | |
parent | e228f6439862359f9b26f9d62634e4fce180b54a (diff) |
ocfs2: rollback alloc_dinode counts when ocfs2_block_group_set_bits() failed
After updating alloc_dinode counts in ocfs2_alloc_dinode_update_counts(),
if ocfs2_alloc_dinode_update_bitmap() failed, there is a rare case that
some space may be lost.
So, roll back alloc_dinode counts when ocfs2_block_group_set_bits()
failed.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Younger Liu <younger.liucn@gmail.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/suballoc.h')
-rw-r--r-- | fs/ocfs2/suballoc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ocfs2/suballoc.h b/fs/ocfs2/suballoc.h index 218d8036b3e7..2d2501767c0c 100644 --- a/fs/ocfs2/suballoc.h +++ b/fs/ocfs2/suballoc.h | |||
@@ -91,6 +91,10 @@ int ocfs2_alloc_dinode_update_counts(struct inode *inode, | |||
91 | struct buffer_head *di_bh, | 91 | struct buffer_head *di_bh, |
92 | u32 num_bits, | 92 | u32 num_bits, |
93 | u16 chain); | 93 | u16 chain); |
94 | void ocfs2_rollback_alloc_dinode_counts(struct inode *inode, | ||
95 | struct buffer_head *di_bh, | ||
96 | u32 num_bits, | ||
97 | u16 chain); | ||
94 | int ocfs2_block_group_set_bits(handle_t *handle, | 98 | int ocfs2_block_group_set_bits(handle_t *handle, |
95 | struct inode *alloc_inode, | 99 | struct inode *alloc_inode, |
96 | struct ocfs2_group_desc *bg, | 100 | struct ocfs2_group_desc *bg, |