diff mbox

[2/2] nfsd4: ignore nfsv4.1 lockowners in nfsd4_release_lockowner

Message ID 1386929026-12627-1-git-send-email-bhalevy@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy Dec. 13, 2013, 10:03 a.m. UTC
RELEASE_LOCKOWNER is a NFSv4.0 operation only so it can quickly skip
lockowners created by nfsv4.1 clients.

Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4state.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Dec. 13, 2013, 2:12 p.m. UTC | #1
>  	list_for_each_entry(sop, &nn->ownerstr_hashtbl[hashval], so_strhash) {
>  		if (sop->so_is_open_owner)
>  			continue;
> +		if (sop->so_client->cl_minorversion)
> +			continue;
>  		if (!same_owner_str(sop, owner, clid))
>  			continue;
>  		list_for_each_entry(stp, &sop->so_stateids,

This needs at least a good comment as it's not very obvious from
glancing over the code.  That being said is same_owner_str so much
overhead that it's really worth it?

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields Dec. 19, 2013, 6:57 p.m. UTC | #2
On Fri, Dec 13, 2013 at 06:12:43AM -0800, Christoph Hellwig wrote:
> >  	list_for_each_entry(sop, &nn->ownerstr_hashtbl[hashval], so_strhash) {
> >  		if (sop->so_is_open_owner)
> >  			continue;
> > +		if (sop->so_client->cl_minorversion)
> > +			continue;
> >  		if (!same_owner_str(sop, owner, clid))
> >  			continue;
> >  		list_for_each_entry(stp, &sop->so_stateids,
> 
> This needs at least a good comment as it's not very obvious from
> glancing over the code.  That being said is same_owner_str so much
> overhead that it's really worth it?
> 

Right, this seems redundant with the cli_id comparison in
same_owner_str.  That could be reordered to ensure it precedes the
memcmp if we think that's worthwhile.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 84007b6..00424f2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4652,6 +4652,8 @@  nfsd4_release_lockowner(struct svc_rqst *rqstp,
 	list_for_each_entry(sop, &nn->ownerstr_hashtbl[hashval], so_strhash) {
 		if (sop->so_is_open_owner)
 			continue;
+		if (sop->so_client->cl_minorversion)
+			continue;
 		if (!same_owner_str(sop, owner, clid))
 			continue;
 		list_for_each_entry(stp, &sop->so_stateids,