f2fs: fix null page reference in redirty_blocks
Subsystems (2)
PATCH v2 1/1 f2fs: fix null page reference in redirty_blocks
From: Daeho Jeong <[email protected]>
Fixed null page reference when find_lock_page() fails in redirty_blocks().
---
v2: changed error value and break the loop when error occurs
--- fs/f2fs/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/f2fs/file.c +4 -2
@@ -4060,8 +4060,10 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)for (i =0 ; i < page_len; i++, redirty_idx++) { page =find_lock_page (mapping, redirty_idx); -if (!page) - ret = -ENOENT ; +if (!page) { + ret = -ENOMEM ; +break ; + }set_page_dirty (page);f2fs_put_page (page,1 );f2fs_put_page (page,0 );
Signature · 8 lines
2.29.2.729.g45daf8777d-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 8 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
Fixed null page reference when
find_lock_page()fails inredirty_blocks().Signed-off-by Daeho Jeong <[email protected]>Reported-by Colin Ian King <[email protected]>Fixes 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE")
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 22 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
Fixed null page reference when
find_lock_page()fails inredirty_blocks().Signed-off-by Daeho Jeong <[email protected]>Reported-by Colin Ian King <[email protected]>Fixes 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE")---
v2: changed error value and break the loop when error occurs--- fs/f2fs/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)fs/f2fs/file.c +0
-0@@ -4060,8 +4060,10 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)for (i =0 ; i < page_len; i++, redirty_idx++) {
fs/f2fs/file.c static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len) · line 4069
Quoted 10 lines
fs/f2fs/file.c +4
-2page =find_lock_page (mapping, redirty_idx); -if (!page) - ret = -ENOENT ; +if (!page) { + ret = -ENOMEM ; +break ; + }set_page_dirty (page);f2fs_put_page (page,1 );f2fs_put_page (page,0 );
Thanks, looks good to me.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 2 lines
Fixed null page reference when
find_lock_page()fails inredirty_blocks().
I suggest to choose an other imperative wording for this change description.
Quoted 1 line
v2: changed error value and break the loop when error occurs
I propose to use a return statement instead of a break in the second if branch for this function implementation.
Regards,
Markus
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Got it~
Thanks,
2021년 1월 5일 (화) 오후 9:06, Markus Elfring <[email protected]>님이 작성:
Quoted 26 lines
Quoted 3 lines
Fixed null page reference when
find_lock_page()fails inredirty_blocks().I suggest to choose an other imperative wording for this change description.
Quoted 1 line
v2: changed error value and break the loop when error occurs
I propose to use a return statement instead of a break in the second if branch for this function implementation.
Regards,
Markus_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Daeho,
FYI
https://www.spinics.net/lists/kernel/msg3595944.html
Quoted 27 lines · Markus Elfring
Quoted 2 lines
Fixed null page reference when
find_lock_page()fails inredirty_blocks().I suggest to choose an other imperative wording for this change description.
Quoted 1 line
v2: changed error value and break the loop when error occurs
I propose to use a return statement instead of a break in the second if branch for this function implementation.
Regards,
Markus_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
.
Thanks for the notice~
2021년 1월 6일 (수) 오전 10:04, Chao Yu <[email protected]>님이 작성:
Quoted 41 lines
Daeho,
FYI
https://www.spinics.net/lists/kernel/msg3595944.html
Quoted 21 lines · Markus Elfring
Quoted 2 lines
Fixed null page reference when
find_lock_page()fails inredirty_blocks().I suggest to choose an other imperative wording for this change description.
Quoted 1 line
v2: changed error value and break the loop when error occurs
I propose to use a return statement instead of a break in the second if branch for this function implementation.
Regards,
MarkusQuoted 6 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
._______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel