-check:
- utime = lli->lli_rmtperm_utime;
- rc = do_check_remote_perm(lli, mask);
- if (!rc || ((rc != -ENOENT) && i))
- RETURN(rc);
+ do {
+ utime = lli->lli_rmtperm_utime;
+ rc = do_check_remote_perm(lli, mask);
+ if (!rc || (rc != -ENOENT && i))
+ break;
+
+ might_sleep();
+
+ down(&lli->lli_rmtperm_sem);
+ /* check again */
+ if (utime != lli->lli_rmtperm_utime) {
+ rc = do_check_remote_perm(lli, mask);
+ if (!rc || (rc != -ENOENT && i)) {
+ up(&lli->lli_rmtperm_sem);
+ break;
+ }
+ }