Jan Kara
2011-Feb-03 13:16 UTC
[Ocfs2-devel] [PATCH] ocfs2: Fix estimate of necessary credits for mkdir
In the rare case that INLINE_DATA, INDEX_DIR, QUOTA, XATTR features are disabled and both the allocation of the directory inode and the allocation of the first directory block need to relink allocation group, there need not be enough credits reserved in a transaction. Fix the estimate. CC: Mark Fasheh <mfasheh at suse.de> Signed-off-by: Jan Kara <jack at suse.cz> --- fs/ocfs2/journal.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) We've actually seen the assertion failing on an old kernel (and thus the filesystem had all those features disabled) but it seems to be theoretically possible with new kernels as well. diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 43e56b9..6180da1 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -405,9 +405,9 @@ static inline int ocfs2_remove_extent_credits(struct super_block *sb) ocfs2_quota_trans_credits(sb); } -/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe + - * bitmap block for the new bit) dx_root update for free list */ -#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1) +/* data block for new dir/symlink, allocation of directory block, dx_root + * update for free list */ +#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + OCFS2_SUBALLOC_ALLOC + 1) static inline int ocfs2_add_dir_index_credits(struct super_block *sb) { -- 1.7.1
Mark Fasheh
2011-Feb-03 18:13 UTC
[Ocfs2-devel] [PATCH] ocfs2: Fix estimate of necessary credits for mkdir
On Thu, Feb 03, 2011 at 02:16:19PM +0100, Jan Kara wrote:> In the rare case that INLINE_DATA, INDEX_DIR, QUOTA, XATTR features are > disabled and both the allocation of the directory inode and the allocation > of the first directory block need to relink allocation group, there need > not be enough credits reserved in a transaction. Fix the estimate. > > CC: Mark Fasheh <mfasheh at suse.de> > Signed-off-by: Jan Kara <jack at suse.cz>Acked-by: Mark Fasheh <mfasheh at suse.com> -- Mark Fasheh
Joel Becker
2011-Feb-20 10:41 UTC
[Ocfs2-devel] [PATCH] ocfs2: Fix estimate of necessary credits for mkdir
On Thu, Feb 03, 2011 at 02:16:19PM +0100, Jan Kara wrote:> In the rare case that INLINE_DATA, INDEX_DIR, QUOTA, XATTR features are > disabled and both the allocation of the directory inode and the allocation > of the first directory block need to relink allocation group, there need > not be enough credits reserved in a transaction. Fix the estimate. > > CC: Mark Fasheh <mfasheh at suse.de> > Signed-off-by: Jan Kara <jack at suse.cz>This patch is now in the fixes branch of ocfs2.git. Joel -- "Glory is fleeting, but obscurity is forever." - Napoleon Bonaparte http://www.jlbec.org/ jlbec at evilplan.org