mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
ext2: unbugger ext2_empty_dir()
commit27e714c007
upstream. In27cfa25895
"ext2: fix fs corruption when trying to remove a non-empty directory with IO error" a funny thing has happened: - page = ext2_get_page(inode, i, dir_has_error, &page_addr); + page = ext2_get_page(inode, i, 0, &page_addr); - if (IS_ERR(page)) { - dir_has_error = 1; - continue; - } + if (IS_ERR(page)) + goto not_empty; And at not_empty: we hit ext2_put_page(page, page_addr), which does put_page(page). Which, unless I'm very mistaken, should oops immediately when given ERR_PTR(-E...) as page. OK, shit happens, insufficiently tested patches included. But when commit in question describes the fault-injection test that exercised that particular failure exit... Ow. CC: stable@vger.kernel.org Fixes:27cfa25895
("ext2: fix fs corruption when trying to remove a non-empty directory with IO error") Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e7c0c943ed
commit
67ffc6dc30
@ -679,7 +679,7 @@ int ext2_empty_dir (struct inode * inode)
|
||||
page = ext2_get_page(inode, i, 0, &page_addr);
|
||||
|
||||
if (IS_ERR(page))
|
||||
goto not_empty;
|
||||
return 0;
|
||||
|
||||
kaddr = page_addr;
|
||||
de = (ext2_dirent *)kaddr;
|
||||
|
Loading…
Reference in New Issue
Block a user