Pārlūkot izejas kodu

f2fs: return -EIO when node id is not matched

During the cleaing of node segments, F2FS can get errored node blocks due to
data race between node page lock and its valid bitmap operations.
In that case, it needs to return an error to skip such the obsolete block copy.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Jaegeuk Kim 11 gadi atpakaļ
vecāks
revīzija
3bb5e2c8fe
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. 1 2
      fs/f2fs/node.c

+ 1 - 2
fs/f2fs/node.c

@@ -958,7 +958,7 @@ repeat:
 		goto got_it;
 		goto got_it;
 
 
 	lock_page(page);
 	lock_page(page);
-	if (unlikely(!PageUptodate(page))) {
+	if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) {
 		f2fs_put_page(page, 1);
 		f2fs_put_page(page, 1);
 		return ERR_PTR(-EIO);
 		return ERR_PTR(-EIO);
 	}
 	}
@@ -967,7 +967,6 @@ repeat:
 		goto repeat;
 		goto repeat;
 	}
 	}
 got_it:
 got_it:
-	f2fs_bug_on(nid != nid_of_node(page));
 	mark_page_accessed(page);
 	mark_page_accessed(page);
 	return page;
 	return page;
 }
 }