* When shutting down NFS rw mounts left over buffers may not be able to
flush during a forced unmount.
* When unable to flush during a forced unmount mark the bp EIO instead
of ESTALE and also mark it B_INVAL to remove the buffer from the the
vnode.
if (info->vp->v_mount->mnt_kern_flag & MNTK_UNMOUNTF) {
m_freem(info->mreq);
info->mreq = NULL;
- return (ESTALE);
+ return (EIO);
}
nmp = VFSTONFS(info->vp->v_mount);
req = kmalloc(sizeof(struct nfsreq), M_NFSREQ, M_WAITOK);
if (error != EINPROGRESS) {
kprintf("nfsm_request_bio: early abort %d\n", error);
bp = info->bio->bio_buf;
- if (error)
+ if (error) {
bp->b_flags |= B_ERROR;
+ if (error == EIO) /* unrecoverable */
+ bp->b_flags |= B_INVAL;
+ }
+
+ /*
+ * This can retry endlessly during a shutdown, change ESTALE
+ * to EIO in this case.
+ */
+ if (shutdown_inprog && error == ESTALE)
+ error = EIO;
bp->b_error = error;
biodone(info->bio);
}