- If all data has been committed to stable storage on the server, it
is safe to turn off the nfsnode's NMODIFIED flag. - Move the check for signals to the top of the loop where we loop around the dirty buffers on the vnode, scheduling writes. This ensures that we'll break ouf of the flush operation on reception of a signal. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
This commit is contained in:
parent
0fe6462ad5
commit
8fefdf0057
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138460
@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
#include <vm/vm_extern.h>
|
||||
#include <vm/vm_object.h>
|
||||
|
||||
@ -2815,6 +2816,10 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct thread *td,
|
||||
s = splbio();
|
||||
VI_LOCK(vp);
|
||||
TAILQ_FOREACH_SAFE(bp, &vp->v_bufobj.bo_dirty.bv_hd, b_bobufs, nbp) {
|
||||
if (nfs_sigintr(nmp, NULL, td)) {
|
||||
error = EINTR;
|
||||
goto done;
|
||||
}
|
||||
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) {
|
||||
if (waitfor != MNT_WAIT || passone)
|
||||
continue;
|
||||
@ -2827,9 +2832,6 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct thread *td,
|
||||
panic("nfs_fsync: inconsistent lock");
|
||||
if (error == ENOLCK)
|
||||
goto loop;
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
if (error)
|
||||
goto done;
|
||||
if (slpflag == PCATCH) {
|
||||
slpflag = 0;
|
||||
slptimeo = 2 * hz;
|
||||
@ -2883,6 +2885,8 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct thread *td,
|
||||
error = np->n_error;
|
||||
np->n_flag &= ~NWRITEERR;
|
||||
}
|
||||
if (commit && vp->v_bufobj.bo_dirty.bv_cnt == 0)
|
||||
np->n_flag &= ~NMODIFIED;
|
||||
done:
|
||||
if (bvec != NULL && bvec != bvec_on_stack)
|
||||
free(bvec, M_TEMP);
|
||||
|
Loading…
Reference in New Issue
Block a user