Skip to content

Commit 54930df

Browse files
jeffmahoneyjankara
authored andcommitted
reiserfs: don't preallocate blocks for extended attributes
Most extended attributes will fit in a single block. More importantly, we drop the reference to the inode while holding the transaction open so the preallocated blocks aren't released. As a result, the inode may be evicted before it's removed from the transaction's prealloc list which can cause memory corruption. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent fd3cfad commit 54930df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/reiserfs/bitmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ static int determine_prealloc_size(reiserfs_blocknr_hint_t * hint)
11281128
hint->prealloc_size = 0;
11291129

11301130
if (!hint->formatted_node && hint->preallocate) {
1131-
if (S_ISREG(hint->inode->i_mode)
1131+
if (S_ISREG(hint->inode->i_mode) && !IS_PRIVATE(hint->inode)
11321132
&& hint->inode->i_size >=
11331133
REISERFS_SB(hint->th->t_super)->s_alloc_options.
11341134
preallocmin * hint->inode->i_sb->s_blocksize)

0 commit comments

Comments
 (0)