From ce8f838dd768e2dca28eb509a9db0e3a66c48321 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 4 Dec 2018 00:15:48 -0500 Subject: [PATCH] add patch missing-unlock-put-page-in-ext4_try_to_write_inline_data --- ...nlock-put-page-in-ext4_try_to_write_inline_data | 35 ++++++++++++++++++++++ series | 1 + timestamps | 10 ++++--- 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 missing-unlock-put-page-in-ext4_try_to_write_inline_data diff --git a/missing-unlock-put-page-in-ext4_try_to_write_inline_data b/missing-unlock-put-page-in-ext4_try_to_write_inline_data new file mode 100644 index 00000000..a7180eea --- /dev/null +++ b/missing-unlock-put-page-in-ext4_try_to_write_inline_data @@ -0,0 +1,35 @@ +ext4: missing unlock/put_page() in ext4_try_to_write_inline_data() + +From: Maurizio Lombardi + +In case of error, ext4_try_to_write_inline_data() should unlock +and release the page it holds. + +Fixes: f19d5870cbf7 ("ext4: add normal write support for inline data") +Signed-off-by: Maurizio Lombardi +Signed-off-by: Theodore Ts'o +--- + fs/ext4/inline.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c +index 9c4bac1..27373d8 100644 +--- a/fs/ext4/inline.c ++++ b/fs/ext4/inline.c +@@ -705,8 +705,11 @@ int ext4_try_to_write_inline_data(struct address_space *mapping, + + if (!PageUptodate(page)) { + ret = ext4_read_inline_page(inode, page); +- if (ret < 0) ++ if (ret < 0) { ++ unlock_page(page); ++ put_page(page); + goto out_up_read; ++ } + } + + ret = 1; +-- +Maurizio Lombardi + + diff --git a/series b/series index 6172e2ff..7749a8a5 100644 --- a/series +++ b/series @@ -3,6 +3,7 @@ use-ext4_sb_bread-to-disambiguate-ENOMEM avoid-long-hold-times-of-j_state_lock-while-committing fix-possible-use-after-free-in-ext4_quota_enable +missing-unlock-put-page-in-ext4_try_to_write_inline_data #################################################### # unstable patches diff --git a/timestamps b/timestamps index 70cac51f..56492dd6 100755 --- a/timestamps +++ b/timestamps @@ -4,7 +4,6 @@ touch -d @1496678952 add-reg_convert_inline_data_nolock touch -d @1496698150 fix-up-ext4_try_to_write_inline_data touch -d @1519010827 do-not-update-superblock-after-shutdown touch -d @1537242017 save-patch -touch -d @1543184431 stable-boundary touch -d @1543184431 use-ext4_sb_bread-to-disambiguate-ENOMEM touch -d @1543184491 stable-boundary-undo.patch touch -d @1543184551 jbd2-dont-double-bump-transaction-number @@ -17,6 +16,9 @@ touch -d @1543184911 load-jmap-from-journal touch -d @1543184971 disable-writeback touch -d @1543185031 add-ext4-journal-lazy-mount-option touch -d @1543896967 avoid-long-hold-times-of-j_state_lock-while-committing -touch -d @1543897389 series -touch -d @1543897395 status -touch -d @1543897926 timestamps +touch -d @1543897682 fix-possible-use-after-free-in-ext4_quota_enable +touch -d @1543900013 missing-unlock-put-page-in-ext4_try_to_write_inline_data +touch -d @1543900073 stable-boundary +touch -d @1543900232 series +touch -d @1543900508 status +touch -d @1543900539 timestamps -- 2.11.4.GIT