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

Collapse All | Expand All

(-)fs/fuse/fuse_node.c (-1 / +10 lines)
Lines 289-295 fuse_vnode_open(struct vnode *vp, int32_ Link Here
289
	 * XXXIP: Handle fd based DIRECT_IO
289
	 * XXXIP: Handle fd based DIRECT_IO
290
	 */
290
	 */
291
	if (fuse_open_flags & FOPEN_DIRECT_IO) {
291
	if (fuse_open_flags & FOPEN_DIRECT_IO) {
292
		VTOFUD(vp)->flag |= FN_DIRECTIO;
292
		ASSERT_VOP_ELOCKED(vp, __func__);
293
		/*
294
		 * If switching from buffer cache I/O to direct I/O, the
295
		 * buffer cache blocks must be invalidated to avoid accessing
296
		 * stale data in the buffer cache.
297
		 */
298
		if ((VTOFUD(vp)->flag & FN_DIRECTIO) == 0) {
299
			VTOFUD(vp)->flag |= FN_DIRECTIO;
300
			fuse_io_invalbuf(vp, td);
301
		}
293
	} else {
302
	} else {
294
	        VTOFUD(vp)->flag &= ~FN_DIRECTIO;
303
	        VTOFUD(vp)->flag &= ~FN_DIRECTIO;
295
	}
304
	}

Return to bug 194293