diff options
author | Jeff Mahoney <jeffm@suse.com> | 2017-06-22 16:35:04 -0400 |
---|---|---|
committer | Sasha Levin <alexander.levin@microsoft.com> | 2018-02-28 22:09:42 -0500 |
commit | 844ae9f552a79c5e1ff1069ec2ac5ba84e344d7b (patch) | |
tree | 7d7fb820cc6735c95a8033c1b97e9605754c8215 /fs | |
parent | 2a99d735ed08b3249fe4eb68fb67d82e5639cee0 (diff) |
reiserfs: don't preallocate blocks for extended attributes
[ Upstream commit 54930dfeb46e978b447af0fb8ab4e181c1bf9d7a ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/bitmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 73705d4bb069..edc8ef78b63f 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -1136,7 +1136,7 @@ static int determine_prealloc_size(reiserfs_blocknr_hint_t * hint) hint->prealloc_size = 0; if (!hint->formatted_node && hint->preallocate) { - if (S_ISREG(hint->inode->i_mode) + if (S_ISREG(hint->inode->i_mode) && !IS_PRIVATE(hint->inode) && hint->inode->i_size >= REISERFS_SB(hint->th->t_super)->s_alloc_options. preallocmin * hint->inode->i_sb->s_blocksize) |