Skip to contentSkip to conversation

reiser4: don't panic in do_readpage_ctail

PATCH New Edward Shishkin 1 participant 1 message Nov 30, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 reiser4: don't panic in do_readpage_ctail

Don't panic when unprepped ctail cluster is found. Instead, return error and suggest to fsck.

---
 fs/reiser4/plugin/item/ctail.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
fs/reiser4/plugin/item/ctail.c +9 -1
@@ -666,7 +666,15 @@ int do_readpage_ctail(struct inode * ino
 
 	switch (clust->dstat) {
 	case UNPR_DISK_CLUSTER:
-		BUG_ON(1);
+		/*
+		 * Page is not uptodate and item cluster is unprepped:
+		 * this must not ever happen.
+		 */
+		warning("edward-1632",
+			"Bad item cluster %lu (Inode %llu). Fsck?",
+			clust->index,
+			(unsigned long long)get_inode_oid(inode));
+		return RETERR(-EIO);
 	case TRNC_DISK_CLUSTER:
 		/*
 		 * Race with truncate!