Whamcloud - gitweb
LU-14713 llite: tighten condition for fault not drop mmap_sem 15/44715/7
authorBobi Jam <bobijam@whamcloud.com>
Thu, 2 Sep 2021 16:38:43 +0000 (00:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:25:38 +0000 (06:25 +0000)
commit81aec05103558f57adb10fd319847304cdf44aa7
tree105354f11b7e6fdbae16d166ba95e47d84a3b2db
parent8a84c7f9c7d65f6f880be6fe4d94fca26a405d81
LU-14713 llite: tighten condition for fault not drop mmap_sem

As __lock_page_or_retry() indicates, filemap_fault() will return
VM_FAULT_RETRY without releasing mmap_sem iff flags contains
FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_RETRY_NOWAIT.

So ll_fault0() should pass in FAULT_FLAG_ALLOW_RETRY |
FAULT_FLAG_RETRY_NOWAIT in ll_filemap_fault() so that when it
returns VM_FAULT_RETRY, we can pass on trying normal fault
under DLM lock as mmap_sem is still being held.

While in Linux 5.1 (6b4c9f4469819) FAULT_FLAG_RETRY_NOWAIT is enough
to not drop mmap_sem when failed to lock the page.

Fixes: 87865e4ae9 ("LU-13182 llite: Avoid eternel retry loops with MAP_POPULATE")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I9420c587301722b597155558657577349a8141e4
Reviewed-on: https://review.whamcloud.com/44715
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_mmap.c