Skip to content

Commit d2d9bb3

Browse files
author
Jaegeuk Kim
committed
f2fs: get out of a repeat loop when getting a locked data page
https://bugzilla.kernel.org/show_bug.cgi?id=216050 Somehow we're getting a page which has a different mapping. Let's avoid the infinite loop. Cc: <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent a3ab557 commit d2d9bb3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

fs/f2fs/data.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,18 +1389,14 @@ struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
13891389
{
13901390
struct address_space *mapping = inode->i_mapping;
13911391
struct page *page;
1392-
repeat:
1392+
13931393
page = f2fs_get_read_data_page(inode, index, 0, for_write, NULL);
13941394
if (IS_ERR(page))
13951395
return page;
13961396

13971397
/* wait for read completion */
13981398
lock_page(page);
1399-
if (unlikely(page->mapping != mapping)) {
1400-
f2fs_put_page(page, 1);
1401-
goto repeat;
1402-
}
1403-
if (unlikely(!PageUptodate(page))) {
1399+
if (unlikely(page->mapping != mapping || !PageUptodate(page))) {
14041400
f2fs_put_page(page, 1);
14051401
return ERR_PTR(-EIO);
14061402
}

0 commit comments

Comments
 (0)