Date: Tue, 16 Dec 2008 21:13:12 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186194 - in head: share/man/man9 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/xfs/FreeBSD sys/ufs/ufs Message-ID: <200812162113.mBGLDCkB047820@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue Dec 16 21:13:11 2008 New Revision: 186194 URL: http://svn.freebsd.org/changeset/base/186194 Log: 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: head/share/man/man9/VOP_STRATEGY.9 head/sys/fs/hpfs/hpfs_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/ntfs/ntfs_vnops.c head/sys/fs/nwfs/nwfs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/gnu/fs/ext2fs/ext2_vnops.c head/sys/gnu/fs/reiserfs/reiserfs_vnops.c head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/share/man/man9/VOP_STRATEGY.9 ============================================================================== --- head/share/man/man9/VOP_STRATEGY.9 Tue Dec 16 20:59:27 2008 (r186193) +++ head/share/man/man9/VOP_STRATEGY.9 Tue Dec 16 21:13:11 2008 (r186194) @@ -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: head/sys/fs/hpfs/hpfs_vnops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/fs/hpfs/hpfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -661,7 +661,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: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -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: head/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/fs/ntfs/ntfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -339,7 +339,7 @@ ntfs_strategy(ap) } } bufdone(bp); - return (error); + return (0); } static int Modified: head/sys/fs/nwfs/nwfs_vnops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/fs/nwfs/nwfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -804,7 +804,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: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -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: head/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -1399,7 +1399,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: head/sys/gnu/fs/reiserfs/reiserfs_vnops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -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: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -1136,7 +1136,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: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Dec 16 20:59:27 2008 (r186193) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Dec 16 21:13:11 2008 (r186194) @@ -2013,7 +2013,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812162113.mBGLDCkB047820>