Whamcloud - gitweb
LU-9319 statahead: skip agl for the file in restoring 01/26501/4
authorFan Yong <fan.yong@intel.com>
Mon, 7 Mar 2016 21:34:36 +0000 (05:34 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 23 Apr 2017 03:11:41 +0000 (03:11 +0000)
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>
lustre/llite/statahead.c

index 5724ac4..5a38893 100644 (file)
@@ -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) {