Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext3: Properly count journal credits for long symlinks

Commit ae54870a1dc9 ("ext3: Fix lock inversion in ext3_symlink()")
recalculated the number of credits needed for a long symlink, in the
process of splitting it into two transactions. However, the first
credit calculation under-counted because if selinux is enabled, credits
are needed to create the selinux xattr as well.

Overrunning the reservation will result in an OOPS in
journal_dirty_metadata() due to this assert:

J_ASSERT_JH(jh, handle->h_buffer_credits > 0);

Fix this by increasing the reservation size.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Sandeen and committed by
Linus Torvalds
d2db60df 72fa5997

+4 -2
+4 -2
fs/ext3/namei.c
··· 2209 2209 /* 2210 2210 * For non-fast symlinks, we just allocate inode and put it on 2211 2211 * orphan list in the first transaction => we need bitmap, 2212 - * group descriptor, sb, inode block, quota blocks. 2212 + * group descriptor, sb, inode block, quota blocks, and 2213 + * possibly selinux xattr blocks. 2213 2214 */ 2214 - credits = 4 + EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb); 2215 + credits = 4 + EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + 2216 + EXT3_XATTR_TRANS_BLOCKS; 2215 2217 } else { 2216 2218 /* 2217 2219 * Fast symlink. We have to add entry to directory