From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48568C04AAC for ; Mon, 20 May 2019 14:22:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 94B6A2177B for ; Mon, 20 May 2019 14:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389884AbfETOWH (ORCPT ); Mon, 20 May 2019 10:22:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60284 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389687AbfETOWG (ORCPT ); Mon, 20 May 2019 10:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E0B7308339E; Mon, 20 May 2019 14:22:04 +0000 (UTC) Received: from [10.10.66.2] (ovpn-66-2.rdu2.redhat.com [10.10.66.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A45718AA2; Mon, 20 May 2019 14:22:01 +0000 (UTC) From: "Benjamin Coddington" To: "Xuewei Zhang" , jlayton@kernel.org Cc: bfields@fieldses.org, "Grigor Avagyan" , "Trevor Bourget" , "Nauman Rafique" , 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 Message-ID: In-Reply-To: References: <3A924C3F-A161-4EE2-A74E-2EE1B6D2CA14@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 20 May 2019 14:22:06 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 >> 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