1 ext4: don't keep using page if inline conversion fails
3 From: "Darrick J. Wong" <darrick.wong@oracle.com>
5 If inline->extent conversion fails (most probably due to ENOSPC) and
6 we release the temporary page that we allocated to transfer the file
7 contents, don't keep using the page pointer after releasing the page.
8 This occasionally leads to complaints about evicting locked pages or
9 hangs when blocksize > pagesize, because it's possible for the page to
10 get reallocated elsewhere in the meantime.
12 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 Reviewed-by: Jan Kara <jack@suse.cz>
15 Cc: Tao Ma <tm@tao.ma>
17 fs/ext4/inline.c | 4 +++-
18 1 file changed, 3 insertions(+), 1 deletion(-)
21 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
22 index bea662b..378aadf 100644
23 --- a/fs/ext4/inline.c
24 +++ b/fs/ext4/inline.c
25 @@ -594,6 +594,7 @@ retry:
28 page_cache_release(page);
30 ext4_orphan_add(handle, inode);
31 up_write(&EXT4_I(inode)->xattr_sem);
33 @@ -613,7 +614,8 @@ retry:
34 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
37 - block_commit_write(page, from, to);
39 + block_commit_write(page, from, to);