Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2006 21:16:14 GMT
From:      Tom Rhodes <trhodes@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 99083 for review
Message-ID:  <200606122116.k5CLGElR018893@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99083

Change 99083 by trhodes@trhodes_local on 2006/06/12 21:15:41

	Wrap four data corruption calls to panic() in vfs_oeaction().

Affected files ...

.. //depot/projects/trhodesbsd/src/sys/fs/msdosfs/msdosfs_vnops.c#2 edit

Differences ...

==== //depot/projects/trhodesbsd/src/sys/fs/msdosfs/msdosfs_vnops.c#2 (text+ko) ====

@@ -1176,7 +1176,10 @@
 		zp->de_fndoffset = from_diroffset;
 		error = removede(zp, ip);
 		if (error) {
-			/* XXX should downgrade to ro here, fs is corrupt */
+			vfs_oeaction(fvp->v_mount, "File system corruption " \
+			    "detected");
+			    brelse(bp);
+			    VOP_UNLOCK(fvp, 0, td);
 			if (newparent)
 				VOP_UNLOCK(fdvp, 0, td);
 			VOP_UNLOCK(fvp, 0, td);
@@ -1186,7 +1189,10 @@
 			error = pcbmap(dp, de_cluster(pmp, to_diroffset), 0,
 				       &ip->de_dirclust, 0);
 			if (error) {
-				/* XXX should downgrade to ro here, fs is corrupt */
+				vfs_oeaction(fvp->v_mount, "File system corruption " \
+				    "detected");
+				    brelse(bp);
+				    VOP_UNLOCK(fvp, 0, td);
 				if (newparent)
 					VOP_UNLOCK(fdvp, 0, td);
 				VOP_UNLOCK(fvp, 0, td);
@@ -1216,7 +1222,10 @@
 		error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster,
 			      NOCRED, &bp);
 		if (error) {
-			/* XXX should downgrade to ro here, fs is corrupt */
+			vfs_oeaction(fvp->v_mount, "File system corruption " \
+			    "detected");
+			    brelse(bp);
+			    VOP_UNLOCK(fvp, 0, td);
 			brelse(bp);
 			VOP_UNLOCK(fvp, 0, td);
 			goto bad;
@@ -1227,7 +1236,10 @@
 			putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16);
 		error = bwrite(bp);
 		if (error) {
-			/* XXX should downgrade to ro here, fs is corrupt */
+			vfs_oeaction(fvp->v_mount, "File system corruption " \
+			    "detected");
+			    brelse(bp);
+			    VOP_UNLOCK(fvp, 0, td);
 			VOP_UNLOCK(fvp, 0, td);
 			goto bad;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606122116.k5CLGElR018893>