Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp724449pxb; Fri, 21 Jan 2022 01:35:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp4JNDADEBu44sXtY/qj1IUAnq3WNSIXPxv78AiDcon78yYPUk61ZnqAWNUFQa0jtgV4bH X-Received: by 2002:a17:902:8bc5:b0:149:88fc:5560 with SMTP id r5-20020a1709028bc500b0014988fc5560mr3362704plo.144.1642757723509; Fri, 21 Jan 2022 01:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642757723; cv=none; d=google.com; s=arc-20160816; b=kP+CnBZh8zI2ySeoC+Vbp4GJd2ein9pCXfcTKygBnzURKU0re1SKyxjRhmKJXkUZs/ MmThdWT1WSr1x1MyNLIub6E8Wr/uB1RSYR9XSpGaZCPQIUgTiZ6WIxoRx4VTx6KfE4Wz Yfd6bA0JCeMaxSWv9xUu3ogAdiF9YqxHDWND6pxF8yGdGh9M0SewrN/OOKvjm4kmAYpJ TdyOZl3e3A8ruLRhhfOmWFSCoiI7ncksMWgFr0qUv1UOZ2cq24dlkK4zo7/dCZ5XbIK7 6VEMqq7x9bSzTuzQQ9LSr4xD0yG8Qas20ZAWJFhkyiHRAPt8VDrwM7DMWRSVR1vQgV+r Oiug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=WGOvI8IIj24h1+BSgxcdMP9CEenlhAccdKKTGcwDqEc=; b=QJNhsVXp8G4Xa7yz4uHccIIP33bVDCa4KQc2JOVnCG7AOS/xousLPKQT/QQdbEvgmN OWjz/dRfmAnFRbKfX9X/RFJm9lCbba1oDvMIRmgu5NtnbvGuZmbZrqrI4Sxo46oiS0AY deu9UgMlSq9fVKLa8sWPR61QKiivZWRCqkomf/xZobrWMHY0OA/ogmEEK16IszuPH7fv 6UlgJq3ZhjFU2eykn8NBAzmgXeSzhIRa6xJviboWFt1quzR99ouPtGMa9zZ8Ir6w0hgF PgR0HSaOLSZWNDR5rLaa2X38flCsXyL09jsQaC6FHGqPC8/tDBZgyIYtMgU4mRriIIij 241A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=rPDCdIaX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t31si5945970pga.276.2022.01.21.01.34.58; Fri, 21 Jan 2022 01:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=rPDCdIaX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349415AbiARWAw (ORCPT + 99 others); Tue, 18 Jan 2022 17:00:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234970AbiARWAw (ORCPT ); Tue, 18 Jan 2022 17:00:52 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E18C061574 for ; Tue, 18 Jan 2022 14:00:52 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id AD1D47932; Tue, 18 Jan 2022 17:00:51 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org AD1D47932 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1642543251; bh=WGOvI8IIj24h1+BSgxcdMP9CEenlhAccdKKTGcwDqEc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rPDCdIaXVEb4GjpFncvEpF46XlIHZZ2RU2K5Fvlk9WCGeC8YiSC5LTlXCg23KzNjd x8f3gOEOI4yjkAWzp5i0veruOj3hppZ5lAOcRWxiKi2ClJm3fFdS0rlg3YD54CZ5aP 7ankNBOEMy+bsQ/jhG4fhySnVuswdZ9KmBbpuJGY= Date: Tue, 18 Jan 2022 17:00:51 -0500 From: Bruce Fields To: Jonathan Woithe Cc: Chuck Lever III , Linux NFS Mailing List Subject: [PATCH 2/2] lockd: fix failure to cleanup client locks Message-ID: <20220118220051.GC16108@fieldses.org> References: <20220115081420.GB8808@marvin.atrad.com.au> <927EED04-840E-4DA6-B2B1-B604A7577B4E@oracle.com> <20220115212336.GB30050@marvin.atrad.com.au> <20220116220627.GA19813@marvin.atrad.com.au> <1E71316C-9EE8-4C71-ADA1-71E2910CA070@oracle.com> <20220117074430.GA22026@marvin.atrad.com.au> <20220117220851.GA8494@marvin.atrad.com.au> <20220117221156.GB3090@fieldses.org> <20220118220016.GB16108@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220118220016.GB16108@fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" In my testing, we're sometimes hitting the request->fl_flags & FL_EXISTS case in posix_lock_inode, presumably just by random luck since we're not actually initializing fl_flags here. This probably didn't matter before 7f024fcd5c97 "Keep read and write fds with each nlm_file" since we wouldn't previously unlock unless we knew there were locks. But now it causes lockd to give up on removing more locks. We could just initialize fl_flags, but really it seems dubious to be calling vfs_lock_file with random values in some of the fields. Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: J. Bruce Fields --- fs/lockd/svcsubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 54c2e42130ca..0a22a2faf552 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -180,6 +180,7 @@ static int nlm_unlock_files(struct nlm_file *file) { struct file_lock lock; + locks_init_lock(&lock); lock.fl_type = F_UNLCK; lock.fl_start = 0; lock.fl_end = OFFSET_MAX; -- 2.34.1