From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 1 11:02:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5473B1065739; Sun, 1 Mar 2009 11:02:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D788FC28; Sun, 1 Mar 2009 11:02:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n21B2cIO041541; Sun, 1 Mar 2009 11:02:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n21B2b6G041531; Sun, 1 Mar 2009 11:02:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200903011102.n21B2b6G041531@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 1 Mar 2009 11:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 11:02:39 -0000 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);