Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115859527
D38503.id119039.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38503.id119039.diff
View Options
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -539,8 +539,8 @@
if (entryoffsetinblock + EXT2_DIR_REC_LEN(ep->e2d_namlen) >
dp->i_size) {
ext2_dirbad(dp, i_offset, "i_size too small");
- dp->i_size = entryoffsetinblock + EXT2_DIR_REC_LEN(ep->e2d_namlen);
- dp->i_flag |= IN_CHANGE | IN_UPDATE;
+ brelse(bp);
+ return (EIO);
}
brelse(bp);
@@ -802,13 +802,9 @@
struct mount *mp;
mp = ITOV(ip)->v_mount;
- if ((mp->mnt_flag & MNT_RDONLY) == 0)
- panic("ext2_dirbad: %s: bad dir ino %ju at offset %ld: %s\n",
- mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number,
- (long)offset, how);
- else
- SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error,
- mp->mnt_stat.f_mntonname, ip->i_number, offset, how);
+
+ SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error,
+ mp->mnt_stat.f_mntonname, ip->i_number, offset, how);
}
/*
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -1088,6 +1088,15 @@
if (namlen != 2 ||
dirbuf->dotdot_name[0] != '.' ||
dirbuf->dotdot_name[1] != '.') {
+ /*
+ * The filesystem is in corrupted state,
+ * need to run fsck to fix mangled dir
+ * entry. From other side this error
+ * need to be ignored because it is
+ * too difficult to revert directories
+ * to state before rename from this
+ * point.
+ */
ext2_dirbad(xp, (doff_t)12,
"rename: mangled dir");
} else {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 4:20 PM (4 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17860876
Default Alt Text
D38503.id119039.diff (1 KB)
Attached To
Mode
D38503: Do not panic in case of corrupted directory
Attached
Detach File
Event Timeline
Log In to Comment