All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Coddington" <bcodding@redhat.com>
To: "Xuewei Zhang" <xueweiz@google.com>, jlayton@kernel.org
Cc: bfields@fieldses.org, "Grigor Avagyan" <grigora@google.com>,
	"Trevor Bourget" <bourget@google.com>,
	"Nauman Rafique" <nauman@google.com>,
	trond.myklebust@hammerspace.com, anna.schumaker@netapp.com,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH] lockd: Show pid of lockd for remote locks
Date: Mon, 20 May 2019 10:22:00 -0400	[thread overview]
Message-ID: <FF6B465E-DA4C-430D-ABEE-6053EF1E9A44@redhat.com> (raw)
In-Reply-To: <C5CB1B1E-59BD-4DB6-82D8-CE8E641CAC5A@redhat.com>

On 20 May 2019, at 9:12, Benjamin Coddington wrote:

> On 18 May 2019, at 22:15, Xuewei Zhang wrote:
>
>> On Sat, May 18, 2019 at 5:09 AM Benjamin Coddington 
>> <bcodding@redhat.com> wrote:
>>>
>>> On 17 May 2019, at 17:45, Xuewei Zhang wrote:
>>>> Seems this patch introduced a bug in how lock protocol handles
>>>> GRANTED_MSG in nfs.
>>>
>>> Yes, you're right: it's broken, and broken badly because we find 
>>> conflicting
>>> locks based on lockd's fl_pid and lockd's fl_owner, which is 
>>> current->files.
>>> That means that clients are not differentiated, and that means that 
>>> v3 locks
>>> are broken.
>>
>> Thanks a lot for the quick response and confirming the problem!
>>
>>>
>>> I'd really like to see the fl_pid value make sense on the server 
>>> when we
>>> show it to userspace, so I think that we should stuff the svid in 
>>> fl_owner.
>>>
>>> Clearly I need to be more careful making changes here, so I am going 
>>> to take
>>> my time fixing this, and I won't get to it until Monday. A revert 
>>> would get
>>> us back to safe behavior.
>>
>> From my limited understanding, b8eee0e90f97 ("lockd: Show pid of 
>> lockd
>> for remote locks")
>> exists only for fixing lockd in 9d5b86ac13c5 ("fs/locks: Remove
>> fl_nspid and use fs-specific...").
>>
>> But I don't see anything wrong in 9d5b86ac13c5 ("fs/locks: Remove
>> fl_nspid and use fs-specific..."). Could you let me know what's the
>> problem? Thanks a lot!
>>
>> If 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific...")
>> is correct, we
>> probably don't need to add another fixing patch. Perhaps reverting 
>> b8eee0e90f97
>> ("lockd: Show pid of lockd for remote locks") would be the best way 
>> then.
>
> I think we have an existing problem:  the NLM server is setting 
> fl_owner to
> current->files and (before the bad patch) fl_pid to svid.
>
> That means that we can't tell the difference between locks from 
> different
> clients that may have the same svid.  The bad patch just made the 
> problem
> far more likely to occur, that's what you're now noticing.

Ok, I just noticed that we set fl_owner to the nlm_host in
nlm4svc_retrieve_args, so things are not as dire as I thought.  What 
would
be nice is a sane set of tests for NLM..

Since we already were placing the nlm_host in fl_owner, I think 
reverting
9d5b86ac13c5 at this point is the proper thing to do.

Ben

  reply	other threads:[~2019-05-20 14:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 21:45 Re: [PATCH] lockd: Show pid of lockd for remote locks Xuewei Zhang
2019-05-18 12:09 ` Benjamin Coddington
2019-05-19  2:15   ` Xuewei Zhang
2019-05-20 13:12     ` Benjamin Coddington
2019-05-20 14:22       ` Benjamin Coddington [this message]
2019-05-20 20:51         ` J. Bruce Fields
2019-05-21 11:18           ` Benjamin Coddington
2019-05-21 14:49             ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2018-11-01 17:39 Benjamin Coddington
2018-11-02 18:45 ` J. Bruce Fields
2018-12-14 17:50   ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FF6B465E-DA4C-430D-ABEE-6053EF1E9A44@redhat.com \
    --to=bcodding@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=bourget@google.com \
    --cc=grigora@google.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nauman@google.com \
    --cc=trond.myklebust@hammerspace.com \
    --cc=xueweiz@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.