View | Details | Raw Unified | Return to bug 259071 | Differences between
and this patch

Collapse All | Expand All

(-)sys/fs/nfsclient/nfs_clbio.c (-3 / +15 lines)
Lines 906-911 ncl_write(struct vop_write_args *ap) Link Here
906
	int bp_cached, n, on, error = 0, error1, save2, wouldcommit;
906
	int bp_cached, n, on, error = 0, error1, save2, wouldcommit;
907
	size_t orig_resid, local_resid;
907
	size_t orig_resid, local_resid;
908
	off_t orig_size, tmp_off;
908
	off_t orig_size, tmp_off;
909
	struct timespec ts;
909
910
910
	KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode"));
911
	KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode"));
911
	KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
912
	KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
Lines 1283-1289 again: Link Here
1283
			break;
1284
			break;
1284
	} while (uio->uio_resid > 0 && n > 0);
1285
	} while (uio->uio_resid > 0 && n > 0);
1285
1286
1286
	if (error != 0) {
1287
	if (error == 0) {
1288
		nanouptime(&ts);
1289
		NFSLOCKNODE(np);
1290
		np->n_localmodtime = ts;
1291
		NFSUNLOCKNODE(np);
1292
	} else {
1287
		if (ioflag & IO_UNIT) {
1293
		if (ioflag & IO_UNIT) {
1288
			VATTR_NULL(&vattr);
1294
			VATTR_NULL(&vattr);
1289
			vattr.va_size = orig_size;
1295
			vattr.va_size = orig_size;
Lines 1355-1360 ncl_vinvalbuf(struct vnode *vp, int flags, struct thre Link Here
1355
	struct nfsmount *nmp = VFSTONFS(vp->v_mount);
1361
	struct nfsmount *nmp = VFSTONFS(vp->v_mount);
1356
	int error = 0, slpflag, slptimeo;
1362
	int error = 0, slpflag, slptimeo;
1357
	bool old_lock;
1363
	bool old_lock;
1364
	struct timespec ts;
1358
1365
1359
	ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf");
1366
	ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf");
1360
1367
Lines 1399-1414 ncl_vinvalbuf(struct vnode *vp, int flags, struct thre Link Here
1399
	}
1406
	}
1400
	if (NFSHASPNFS(nmp)) {
1407
	if (NFSHASPNFS(nmp)) {
1401
		nfscl_layoutcommit(vp, td);
1408
		nfscl_layoutcommit(vp, td);
1409
		nanouptime(&ts);
1402
		/*
1410
		/*
1403
		 * Invalidate the attribute cache, since writes to a DS
1411
		 * Invalidate the attribute cache, since writes to a DS
1404
		 * won't update the size attribute.
1412
		 * won't update the size attribute.
1405
		 */
1413
		 */
1406
		NFSLOCKNODE(np);
1414
		NFSLOCKNODE(np);
1407
		np->n_attrstamp = 0;
1415
		np->n_attrstamp = 0;
1408
	} else
1416
	} else {
1417
		nanouptime(&ts);
1409
		NFSLOCKNODE(np);
1418
		NFSLOCKNODE(np);
1410
	if (np->n_directio_asyncwr == 0)
1419
	}
1420
	if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) {
1421
		np->n_localmodtime = ts;
1411
		np->n_flag &= ~NMODIFIED;
1422
		np->n_flag &= ~NMODIFIED;
1423
	}
1412
	NFSUNLOCKNODE(np);
1424
	NFSUNLOCKNODE(np);
1413
out:
1425
out:
1414
	ncl_excl_finish(vp, old_lock);
1426
	ncl_excl_finish(vp, old_lock);
(-)sys/fs/nfsclient/nfs_clvnops.c (+7 lines)
Lines 2896-2901 ncl_flush(struct vnode *vp, int waitfor, struct thread Link Here
2896
#endif
2896
#endif
2897
	struct buf *bvec_on_stack[NFS_COMMITBVECSIZ];
2897
	struct buf *bvec_on_stack[NFS_COMMITBVECSIZ];
2898
	u_int bvecsize = 0, bveccount;
2898
	u_int bvecsize = 0, bveccount;
2899
	struct timespec ts;
2899
2900
2900
	if (called_from_renewthread != 0)
2901
	if (called_from_renewthread != 0)
2901
		slptimeo = hz;
2902
		slptimeo = hz;
Lines 3215-3220 done: Link Here
3215
		}
3216
		}
3216
		vn_printf(vp, "ncl_flush failed");
3217
		vn_printf(vp, "ncl_flush failed");
3217
		error = called_from_renewthread != 0 ? EIO : EBUSY;
3218
		error = called_from_renewthread != 0 ? EIO : EBUSY;
3219
	}
3220
	if (error == 0) {
3221
		nanouptime(&ts);
3222
		NFSLOCKNODE(np);
3223
		np->n_localmodtime = ts;
3224
		NFSUNLOCKNODE(np);
3218
	}
3225
	}
3219
	return (error);
3226
	return (error);
3220
}
3227
}

Return to bug 259071