Skip to contentSkip to conversation

GFS2: Withdraw when directory entry inconsistencies are detected

PATCH New Bob Peterson 1 participant 1 message May 26, 2017 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: Withdraw when directory entry inconsistencies are detected

Hi,

This patch prints an inode consistency error and withdraws the file system when directory entry counts are mismatched.

---

fs/gfs2/dir.c +2 -1
index 7911321..96a7487 100644
@@ -1444,7 +1444,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
 						"g.offset (%u)\n",
 					(unsigned long long)bh->b_blocknr,
 					entries2, g.offset);
-					
+				gfs2_consist_inode(ip);
 				error = -EIO;
 				goto out_free;
 			}
@@ -1612,6 +1612,7 @@ int gfs2_dir_read(struct inode *inode, struct dir_context *ctx,
 				(unsigned long long)dip->i_no_addr,
 				dip->i_entries,
 				g.offset);
+			gfs2_consist_inode(dip);
 			error = -EIO;
 			goto out;
 		}