Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284621
b: refs/heads/master
c: b93d87c
h: refs/heads/master
i:
  284619: 25763d3
v: v3
  • Loading branch information
J. Bruce Fields committed Nov 8, 2011
1 parent 527501c commit 8225d97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8e6defe7f4456d8700e5a3796a1e9fb54a88543
refs/heads/master: b93d87c19821ba7d3ee11557403d782e541071ad
17 changes: 15 additions & 2 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -3809,16 +3809,29 @@ nfs4_set_lock_denied(struct file_lock *fl, struct nfsd4_lock_denied *deny)
deny->ld_type = NFS4_WRITE_LT;
}

static bool same_lockowner_ino(struct nfs4_lockowner *lo, struct inode *inode, clientid_t *clid, struct xdr_netobj *owner)
{
struct nfs4_ol_stateid *lst;

if (!same_owner_str(&lo->lo_owner, owner, clid))
return false;
lst = list_first_entry(&lo->lo_owner.so_stateids,
struct nfs4_ol_stateid, st_perstateowner);
return lst->st_file->fi_inode == inode;
}

static struct nfs4_lockowner *
find_lockowner_str(struct inode *inode, clientid_t *clid,
struct xdr_netobj *owner)
{
unsigned int hashval = lock_ownerstr_hashval(inode, clid->cl_id, owner);
struct nfs4_lockowner *lo;
struct nfs4_stateowner *op;

list_for_each_entry(op, &lock_ownerstr_hashtbl[hashval], so_strhash) {
if (same_owner_str(op, owner, clid))
return lockowner(op);
lo = lockowner(op);
if (same_lockowner_ino(lo, inode, clid, owner))
return lo;
}
return NULL;
}
Expand Down

0 comments on commit 8225d97

Please sign in to comment.