1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

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
This commit is contained in:
Edward Tomasz Napierala 2008-12-16 21:13:11 +00:00
parent 41c8b468e6
commit 0da50f6ef8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186194
10 changed files with 17 additions and 10 deletions

View File

@ -53,7 +53,9 @@ This call either reads or writes data from a file, depending on the value of
.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

View File

@ -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);

View File

@ -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);

View File

@ -339,7 +339,7 @@ ntfs_strategy(ap)
}
}
bufdone(bp);
return (error);
return (0);
}
static int

View File

@ -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);
}

View File

@ -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

View File

@ -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);

View File

@ -350,8 +350,13 @@ reiserfs_strategy(struct vop_strategy_args /* {
bp->b_ioflags |= BIO_ERROR;
}
if (error) {
bp->b_ioflags |= BIO_ERROR;
bp->b_error = error;
}
bufdone(bp);
return (error);
return (0);
}
/*

View File

@ -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);

View File

@ -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);