X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fremote_perm.c;h=8cc8c65cf327fd25cdf05433009f01d74becbd71;hb=110d8d4952a9de607cf21f648d75e0b05ef0cee1;hp=c9faae67b10ecb94475c7604549bb87e6277beb5;hpb=1b2547843817b4b7adbeb87ea9b070d9cac35c90;p=fs%2Flustre-release.git diff --git a/lustre/llite/remote_perm.c b/lustre/llite/remote_perm.c index c9faae6..8cc8c65 100644 --- a/lustre/llite/remote_perm.c +++ b/lustre/llite/remote_perm.c @@ -127,24 +127,24 @@ static int do_check_remote_perm(struct ll_inode_info *lli, int mask) int found = 0, rc; ENTRY; - if (!lli->lli_remote_perms) - RETURN(-ENOENT); + if (!lli->lli_remote_perms) + RETURN(-ENOENT); - head = lli->lli_remote_perms + remote_perm_hashfunc(cfs_curproc_uid()); + head = lli->lli_remote_perms + remote_perm_hashfunc(current_uid()); spin_lock(&lli->lli_lock); - cfs_hlist_for_each_entry(lrp, node, head, lrp_list) { - if (lrp->lrp_uid != cfs_curproc_uid()) - continue; - if (lrp->lrp_gid != cfs_curproc_gid()) - continue; - if (lrp->lrp_fsuid != cfs_curproc_fsuid()) - continue; - if (lrp->lrp_fsgid != cfs_curproc_fsgid()) - continue; - found = 1; - break; - } + cfs_hlist_for_each_entry(lrp, node, head, lrp_list) { + if (lrp->lrp_uid != current_uid()) + continue; + if (lrp->lrp_gid != current_gid()) + continue; + if (lrp->lrp_fsuid != current_fsuid()) + continue; + if (lrp->lrp_fsgid != current_fsgid()) + continue; + found = 1; + break; + } if (!found) GOTO(out, rc = -ENOENT); @@ -257,23 +257,23 @@ int lustre_check_remote_perm(struct inode *inode, int mask) int i = 0, rc; ENTRY; - do { - save = lli->lli_rmtperm_time; - rc = do_check_remote_perm(lli, mask); - if (!rc || (rc != -ENOENT && i)) - break; + do { + save = lli->lli_rmtperm_time; + rc = do_check_remote_perm(lli, mask); + if (!rc || (rc != -ENOENT && i)) + break; - cfs_might_sleep(); + might_sleep(); mutex_lock(&lli->lli_rmtperm_mutex); - /* check again */ - if (save != lli->lli_rmtperm_time) { - rc = do_check_remote_perm(lli, mask); - if (!rc || (rc != -ENOENT && i)) { + /* check again */ + if (save != lli->lli_rmtperm_time) { + rc = do_check_remote_perm(lli, mask); + if (!rc || (rc != -ENOENT && i)) { mutex_unlock(&lli->lli_rmtperm_mutex); - break; - } - } + break; + } + } if (i++ > 5) { CERROR("check remote perm falls in dead loop!\n");