From 98270274cca545b79d2cf505ebfe2eae5c4fb374 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Tue, 8 Mar 2016 05:34:36 +0800 Subject: [PATCH] LU-9319 statahead: skip agl for the file in restoring In case of restore, the MDT has the right size and has already sent it back without granting the layout lock, inode is up-to-date. Then AGL (async glimpse lock) is useless. Also to glimpse we need the layout, in case of a running restore the MDT holds the layout lock so the glimpse will block up to the end of restore (statahead/agl will block). Signed-off-by: Fan Yong Change-Id: Iaaf138a28671c3eccfb05b08ce8d7364423256a1 Reviewed-by: Lai Siyao Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-on: https://review.whamcloud.com/26501 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/statahead.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index 5724ac4..5a38893 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -506,6 +506,18 @@ static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai) RETURN_EXIT; } + /* In case of restore, the MDT has the right size and has already + * sent it back without granting the layout lock, inode is up-to-date. + * Then AGL (async glimpse lock) is useless. + * Also to glimpse we need the layout, in case of a runninh restore + * the MDT holds the layout lock so the glimpse will block up to the + * end of restore (statahead/agl will block) */ + if (ll_file_test_flag(lli, LLIF_FILE_RESTORING)) { + lli->lli_agl_index = 0; + iput(inode); + RETURN_EXIT; + } + /* Someone is in glimpse (sync or async), do nothing. */ rc = down_write_trylock(&lli->lli_glimpse_sem); if (rc == 0) { -- 1.8.3.1