- Always return success from NFS strategy. nfs_doio(), in the
event of an error, does the right thing, in terms of setting the error flags in the buf header. That fixes a crash from bstrategy(). - Treat ETIMEDOUT as a "recoverable" error, causing the buffer to be re-dirtied. ETIMEDOUT can occur on soft mounts, when the number of retries are exceeded, and we don't want data loss in that case. Submitted by: Mohan Srinivasan
This commit is contained in:
parent
d0a14f55c3
commit
3834aac17e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=152656
@ -1605,7 +1605,7 @@ nfs_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td)
|
||||
* bp in this case is not an NFS cache block so we should
|
||||
* be safe. XXX
|
||||
*/
|
||||
if (error == EINTR || error == EIO
|
||||
if (error == EINTR || error == EIO || error == ETIMEDOUT
|
||||
|| (!error && (bp->b_flags & B_NEEDCOMMIT))) {
|
||||
int s;
|
||||
|
||||
|
@ -2564,7 +2564,6 @@ nfs_strategy(struct vop_strategy_args *ap)
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct ucred *cr;
|
||||
struct thread *td;
|
||||
int error = 0;
|
||||
|
||||
KASSERT(!(bp->b_flags & B_DONE), ("nfs_strategy: buffer %p unexpectedly marked B_DONE", bp));
|
||||
KASSERT(BUF_REFCNT(bp) > 0, ("nfs_strategy: buffer %p not locked", bp));
|
||||
@ -2585,9 +2584,9 @@ nfs_strategy(struct vop_strategy_args *ap)
|
||||
* otherwise just do it ourselves.
|
||||
*/
|
||||
if ((bp->b_flags & B_ASYNC) == 0 ||
|
||||
nfs_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, td))
|
||||
error = nfs_doio(ap->a_vp, bp, cr, td);
|
||||
return (error);
|
||||
nfs_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, td))
|
||||
(void)nfs_doio(ap->a_vp, bp, cr, td);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user