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 <fan.yong@intel.com>
Change-Id: Iaaf138a28671c3eccfb05b08ce8d7364423256a1
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: https://review.whamcloud.com/26501
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
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) {