svn commit: r189226 - in stable/7: share/man/man9 sys sys/contrib/pf sys/dev/cxgb sys/fs/hpfs sys/fs/msdosfs sys/fs/ntfs sys/fs/nwfs sys/fs/smbfs sys/gnu/fs/ext2fs sys/gnu/fs/reiserfs sys/gnu/fs/xf...

Edward Tomasz Napierala trasz at FreeBSD.org
Sun Mar 1 03:02:39 PST 2009


Author: trasz
Date: Sun Mar  1 11:02:37 2009
New Revision: 189226
URL: http://svn.freebsd.org/changeset/base/189226

Log:
  MFC r186194:
  
  According to phk@, VOP_STRATEGY should never, _ever_, return
  anything other than 0.  Make it so.  This fixes
  "panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
  encountered when writing to an orphaned filesystem.  Reason
  for the panic was the following assert:
  KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
  at vfs_bio:bufstrategy().
  
  Reviewed by:	scottl, phk
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation

Modified:
  stable/7/share/man/man9/   (props changed)
  stable/7/share/man/man9/VOP_STRATEGY.9
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/fs/hpfs/hpfs_vnops.c
  stable/7/sys/fs/msdosfs/msdosfs_vnops.c
  stable/7/sys/fs/ntfs/ntfs_vnops.c
  stable/7/sys/fs/nwfs/nwfs_vnops.c
  stable/7/sys/fs/smbfs/smbfs_vnops.c
  stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c
  stable/7/sys/gnu/fs/reiserfs/reiserfs_vnops.c
  stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
  stable/7/sys/ufs/ufs/ufs_vnops.c

Modified: stable/7/share/man/man9/VOP_STRATEGY.9
==============================================================================
--- stable/7/share/man/man9/VOP_STRATEGY.9	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/share/man/man9/VOP_STRATEGY.9	Sun Mar  1 11:02:37 2009	(r189226)
@@ -53,7 +53,9 @@ This call either reads or writes data fr
 .Pp
 The call may block.
 .Sh RETURN VALUES
-Zero is returned on success, otherwise an error is returned.
+Always zero.
+Errors should be signalled by setting BIO_ERROR on b_ioflags field in struct buf,
+and setting b_error to the appropriate errno value.
 .Sh SEE ALSO
 .\" .Xr buf 9 ,
 .Xr vnode 9

Modified: stable/7/sys/fs/hpfs/hpfs_vnops.c
==============================================================================
--- stable/7/sys/fs/hpfs/hpfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/fs/hpfs/hpfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -663,7 +663,7 @@ hpfs_strategy(ap)
 			bp->b_error = error;
 			bp->b_ioflags |= BIO_ERROR;
 			bufdone(bp);
-			return (error);
+			return (0);
 		}
 		if ((long)bp->b_blkno == -1)
 			vfs_bio_clrbuf(bp);

Modified: stable/7/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- stable/7/sys/fs/msdosfs/msdosfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/fs/msdosfs/msdosfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -1880,7 +1880,7 @@ msdosfs_strategy(ap)
 			bp->b_error = error;
 			bp->b_ioflags |= BIO_ERROR;
 			bufdone(bp);
-			return (error);
+			return (0);
 		}
 		if ((long)bp->b_blkno == -1)
 			vfs_bio_clrbuf(bp);

Modified: stable/7/sys/fs/ntfs/ntfs_vnops.c
==============================================================================
--- stable/7/sys/fs/ntfs/ntfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/fs/ntfs/ntfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -339,7 +339,7 @@ ntfs_strategy(ap)
 		}
 	}
 	bufdone(bp);
-	return (error);
+	return (0);
 }
 
 static int

Modified: stable/7/sys/fs/nwfs/nwfs_vnops.c
==============================================================================
--- stable/7/sys/fs/nwfs/nwfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/fs/nwfs/nwfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -807,7 +807,7 @@ static int nwfs_strategy (ap) 
 	 */
 	if ((bp->b_flags & B_ASYNC) == 0 )
 		error = nwfs_doio(ap->a_vp, bp, cr, td);
-	return (error);
+	return (0);
 }
 
 

Modified: stable/7/sys/fs/smbfs/smbfs_vnops.c
==============================================================================
--- stable/7/sys/fs/smbfs/smbfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/fs/smbfs/smbfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -864,7 +864,7 @@ smbfs_strategy (ap) 
 
 	if ((bp->b_flags & B_ASYNC) == 0 )
 		error = smbfs_doio(ap->a_vp, bp, cr, td);
-	return error;
+	return (0);
 }
 
 int

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -1408,7 +1408,7 @@ ext2_strategy(ap)
 			bp->b_error = error;
 			bp->b_ioflags |= BIO_ERROR;
 			bufdone(bp);
-			return (error);
+			return (0);
 		}
 		if ((long)bp->b_blkno == -1)
 			vfs_bio_clrbuf(bp);

Modified: stable/7/sys/gnu/fs/reiserfs/reiserfs_vnops.c
==============================================================================
--- stable/7/sys/gnu/fs/reiserfs/reiserfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/gnu/fs/reiserfs/reiserfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -350,8 +350,13 @@ reiserfs_strategy(struct vop_strategy_ar
 		bp->b_ioflags |= BIO_ERROR;
 	}
 
+	if (error) {
+		bp->b_ioflags |= BIO_ERROR;
+		bp->b_error = error;
+	}
+
 	bufdone(bp);
-	return (error);
+	return (0);
 }
 
 /*

Modified: stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
==============================================================================
--- stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -1138,7 +1138,7 @@ _xfs_strategy(
 			bp->b_error = error;
 			bp->b_ioflags |= BIO_ERROR;
 			bufdone(bp);
-			return (error);
+			return (0);
 		}
 		if ((long)bp->b_blkno == -1)
 			vfs_bio_clrbuf(bp);

Modified: stable/7/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_vnops.c	Sun Mar  1 11:01:00 2009	(r189225)
+++ stable/7/sys/ufs/ufs/ufs_vnops.c	Sun Mar  1 11:02:37 2009	(r189226)
@@ -2015,7 +2015,7 @@ ufs_strategy(ap)
 			bp->b_error = error;
 			bp->b_ioflags |= BIO_ERROR;
 			bufdone(bp);
-			return (error);
+			return (0);
 		}
 		if ((long)bp->b_blkno == -1)
 			vfs_bio_clrbuf(bp);


More information about the svn-src-all mailing list