From 3183c104a7526e87d10c2d4e474fbbd08728fe8d Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Thu, 31 Jan 2013 16:36:19 +0400 Subject: [PATCH 1/1] LU-2723 clio: a client hangs on osc_extent_wait in dio If dio overlaps with mapped region, first overlapped pages are sent by generic_file_direct_write->filemap_write_and_wait_range->writepages After that the dio pages are sent by write_begin/write_end, writepages However, write_end->osc_page_cache_add does not release extent because the IO is not considered as synchronous. as the result, the following writepages->osc_cache_writeback_range() does not send pages as the extent is still ACTIVE and osc_cache_wait_range() hangs forever. The patch make directIO to be considered as sync by lustre so that extent was released at write_end. Signed-off-by: Vitaly Fertman Xyratex-bug-id: MRP-839 Change-Id: I0c0e1599ee180f467826e4b6715c3cbfd0c6eb5c Reviewed-on: http://review.whamcloud.com/5224 Reviewed-by: Jinshan Xiong Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 6e5aa43..c2d75fc 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -836,7 +836,9 @@ void ll_io_init(struct cl_io *io, const struct file *file, int write) io->u.ci_rw.crw_nonblock = file->f_flags & O_NONBLOCK; if (write) { io->u.ci_wr.wr_append = !!(file->f_flags & O_APPEND); - io->u.ci_wr.wr_sync = file->f_flags & O_SYNC || IS_SYNC(inode); + io->u.ci_wr.wr_sync = file->f_flags & O_SYNC || + file->f_flags & O_DIRECT || + IS_SYNC(inode); } io->ci_obj = ll_i2info(inode)->lli_clob; io->ci_lockreq = CILR_MAYBE; -- 1.8.3.1