Whamcloud - gitweb
LU-9319 statahead: skip agl for the file in restoring
[fs/lustre-release.git] / 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) {