/* remote permission hash */
struct hlist_head *lli_remote_perms;
+ unsigned long lli_rmtperm_utime;
struct semaphore lli_rmtperm_sem;
struct list_head lli_dead_list;
lli->lli_open_fd_exec_count = 0;
INIT_LIST_HEAD(&lli->lli_dead_list);
lli->lli_remote_perms = NULL;
+ lli->lli_rmtperm_utime = 0;
sema_init(&lli->lli_rmtperm_sem, 1);
INIT_LIST_HEAD(&lli->lli_oss_capas);
}
lrp->lrp_access_perm = perm->rp_access_perm;
if (lrp != tmp)
hlist_add_head(&lrp->lrp_list, head);
+ lli->lli_rmtperm_utime = jiffies;
spin_unlock(&lli->lli_lock);
CDEBUG(D_SEC, "new remote perm@%p: %u/%u/%u/%u - %#x\n",
struct ptlrpc_request *req = NULL;
struct mdt_remote_perm *perm;
struct obd_capa *oc;
+ unsigned long utime;
int i = 0, rc;
ENTRY;
check:
+ utime = lli->lli_rmtperm_utime;
rc = do_check_remote_perm(lli, mask);
if (!rc || ((rc != -ENOENT) && i))
RETURN(rc);
down(&lli->lli_rmtperm_sem);
/* check again */
- rc = do_check_remote_perm(lli, mask);
- if (!rc || ((rc != -ENOENT) && i)) {
- up(&lli->lli_rmtperm_sem);
- RETURN(rc);
+ if (utime != lli->lli_rmtperm_utime) {
+ rc = do_check_remote_perm(lli, mask);
+ if (!rc || ((rc != -ENOENT) && i)) {
+ up(&lli->lli_rmtperm_sem);
+ RETURN(rc);
+ }
}
if (i++ > 5) {