LU-14072 llite: fix client evicition with DIO
We set lockless in file open if O_DIRECT flag is passed,
however O_DIRECT flag could be cleared by
fcntl(..., F_SETFL, ...).
Finally we comes to a case where buffer IO without lock
held properly, and hit hang:
[<
ffffffffc0d421ed>] osc_extent_wait+0x21d/0x7c0 [osc]
[<
ffffffffc0d44897>] osc_cache_wait_range+0x2e7/0x940 [osc]
[<
ffffffffc0d4585e>] osc_cache_writeback_range+0x96e/0xff0 [osc]
[<
ffffffffc0d31c45>] osc_lock_flush+0x195/0x290 [osc]
[<
ffffffffc0d31d7c>] osc_lock_lockless_cancel+0x3c/0xe0 [osc]
[<
ffffffffc081f488>] cl_lock_cancel+0x78/0x160 [obdclass]
[<
ffffffffc0cd8079>] lov_lock_cancel+0x99/0x190 [lov]
[<
ffffffffc081f488>] cl_lock_cancel+0x78/0x160 [obdclass]
[<
ffffffffc081f9a2>] cl_lock_release+0x52/0x140 [obdclass]
[<
ffffffffc08238a9>] cl_io_unlock+0x139/0x290 [obdclass]
[<
ffffffffc08242e8>] cl_io_loop+0xb8/0x200 [obdclass]
[<
ffffffffc0e1d36b>] ll_file_io_generic+0x91b/0xdf0 [lustre]
[<
ffffffffc0e1dd0c>] ll_file_aio_write+0x29c/0x6e0 [lustre]
[<
ffffffffc0e1e250>] ll_file_write+0x100/0x1c0 [lustre]
[<
ffffffffa984aa90>] vfs_write+0xc0/0x1f0
[<
ffffffffa984b8af>] SyS_write+0x7f/0xf0
[<
ffffffffa9d8eede>] system_call_fastpath+0x25/0x2a
[<
ffffffffffffffff>] 0xffffffffffffffff
Lock cancel time out in the server side and client
eviction happen.
Fix this problem by testing O_DIRECT flag to decide if
we could issue lockless IO.
Fixes:
6bce536725 ("LU-4198 clio: turn on lockless for some kind of IO")
Change-Id: Idbf1c748684a6540aee5f6e35c017929fbcc60b9
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/40389
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>