summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-11-21 19:23:46 +0000
committerps <ps@FreeBSD.org>2005-11-21 19:23:46 +0000
commit6364b280f8c021890b7197124558e6b448888c03 (patch)
tree6ba2c8e7d1aaff8621b20d87076ec42196255126 /sys
parent6b40ef55c34c5b06f335f63f127ff9eeccd79de1 (diff)
downloadFreeBSD-src-6364b280f8c021890b7197124558e6b448888c03.zip
FreeBSD-src-6364b280f8c021890b7197124558e6b448888c03.tar.gz
- 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
Diffstat (limited to 'sys')
-rw-r--r--sys/nfsclient/nfs_bio.c2
-rw-r--r--sys/nfsclient/nfs_vnops.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 3018dda..896bb17 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -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;
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 2cbf834..6634190 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -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);
}
/*
OpenPOWER on IntegriCloud