Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1187226pxb; Fri, 21 Jan 2022 11:47:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcR0ywHz9w4aPhzfO9hdWN83GwdA0JfBfuBHlPLcvKQnaP2EQZGVR065SH96gK0FEiCycK X-Received: by 2002:a63:6e86:: with SMTP id j128mr4019023pgc.6.1642794470443; Fri, 21 Jan 2022 11:47:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1642794470; cv=pass; d=google.com; s=arc-20160816; b=BH7oTU15fBVbcqgAhNGnhVpY1LvAkz1KhK9mf0a37KdHBWmLyGVjNOe1FRnwABfPa0 bU+WvtqHUL0rqexs+LWaRHwdmqJQ5GB2YYDYMwQkrgmMnCURejG1K6UfqRWAxfnu/o85 UioPtjR7VoFbsBRjaeLkJUEms+V3gKFEfxHfVRHhGif7KYoa6RG53aIsPViLbff1mdkC tx7p5Mt9YPDkEE+q4F1tzAm5t7UUxUeGaosTBllMi3AcsHCGW8trjXUyn5gDQxPtY6hi XAWNtyBGBjnWyNsEsjhYD3dcfcYhDQwTtsBiE6SiGcFNvfTjjuWBKFAPZ4t2b55AlSOd 5A+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=k8dh32Ritnzmk2hdmQewQZTi2qo17f464Fb7HgR9kcQ=; b=Kr5HgDKmhsC1fpgENQapNRt324ygVsRfHznfNQqKl1CrrXb1hfvNvBEdINqSMtE+Tu EyjIZSNNjYfgGfh0hjTpuEw1zyCsUbKsKU2u3AG+Tqozv0umlwUGFQngpRtKKZpdkaGA Gq4QJvJLJ4uXlDU5Qa/PEUZT/3Dxct7BKP17bLNKJwxvjrATL7kOuv//vPqhf80RKQiJ jDConaZWCX/VylsGFW8kGW+gmaq7caTu2xm5E1aB6G7seEs2MKeQWss9Tn+SEGew1/OT 84vgeFfxXps/uSZc8Z6QTqq8X5fU/Q8ekXKbRDk6wkf+tWhVhwlyTGXquRAprSwfXghd ipTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Zjrb5F6f; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=c27XDlbH; arc=pass (i=1); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si8043468pfu.177.2022.01.21.11.47.13; Fri, 21 Jan 2022 11:47:50 -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=@oracle.com header.s=corp-2021-07-09 header.b=Zjrb5F6f; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=c27XDlbH; arc=pass (i=1); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351854AbiASQTB (ORCPT + 99 others); Wed, 19 Jan 2022 11:19:01 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:20910 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346196AbiASQTA (ORCPT ); Wed, 19 Jan 2022 11:19:00 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20JE42KB010647; Wed, 19 Jan 2022 16:18:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=k8dh32Ritnzmk2hdmQewQZTi2qo17f464Fb7HgR9kcQ=; b=Zjrb5F6fn6HgsorY6WWyDztIu0uQrxLvNluAoTlBksnbrmfVUhn4BqMJ7CxFmiUxzLei UZLFai+NJO1ABQY+v+Po3coWRoObFFmr+CfFJvKPfWoPTfoyM9T4SjicDIQYQUUQMlZh LkjwP/m2YjrN+SMxLGh866TS37BpJyDZXkS+8cpoTP6eLi7zSKesdP3xhLnNKlgkKQ2r qTbnylK3leJ3v7HVfvGZJJmXIA4egaVCjAzIZq2brNzpAaMWGLQhFD9dXOWnqH7omCWN N6eVYSFvTxZ6Mzq4EQpWT5NSAQVSVgDsYETk61l36wfsD+vfzbv3v/XYL/Ot+eMhXLN1 aw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dnc52wkex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jan 2022 16:18:15 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20JGGcFi052510; Wed, 19 Jan 2022 16:18:13 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by userp3030.oracle.com with ESMTP id 3dkkd0kgcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jan 2022 16:18:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WX/jeU18jD0VzTy7I+C3D0RpFUoL78+FrxqG45nIQqEDms9yvBaMi4Pp1UZmw8zhx5ipuu4ju3E4osPlmAbSy36jHVHby+trAcBbVFhqp39N6F2uGHBFrkVlj9R3HFa9yQrG671Bs2iQTV3CGQSqxhlb7RUUYaJc9MiCUE5JjbVXH+phXT1yMNOHCf2SSlcmGqaUCLpxyoNJUb40x3JfmNoRSQwWzTIU6QS7RfEzolqbzqUvyKfyWfk1fJDxdzFvF2rbtjHJmLY2ADMfFNt+Zw+arseIWyt4+VMZKf91gEdJ5EvLpRO8+dipToBDpsIGtV7zaEnkEvC5j7vlUw7Gug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=k8dh32Ritnzmk2hdmQewQZTi2qo17f464Fb7HgR9kcQ=; b=XG7EwrFJosqHlgieMdAUL0zEPpe/lxvTSGIvArrrMAuY+qzGHYjV17twZ5xM4662rjbPwEdck339ThwEExGSp5eifZ4we1gZDsoVWDZlEvAHPtTuG8VRoMxyy5y/wUEOaOUXtesYhC1oiwlfkQYnxklhYIGl9QmRvN4NsjGugYwh+RKLJN0Dq9fGJrQx4BeID+IjTBRrzMefNh+/dMExRJTmaC6kYK+qkeIzqF+L04IniCi24Bqv4ps7x9IAgJn7qsN/g1oDOk/t+Q6eVpviLaOQCYhfl84ds2ihvcEOo/Gq3PlYJEZvDF4NmQJtOEPlxE+vfpMrx+R3jOD++ZbSTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k8dh32Ritnzmk2hdmQewQZTi2qo17f464Fb7HgR9kcQ=; b=c27XDlbHCTvPE0i7RL3xrr/w6WqPl9OW9yAacKd58Csfiq+qRlvkOCtH/68JJMoS5XIgvztnyNfa/XPdYSOAbsNRYedILV+w+KuePpkKb7V539XmYxQxPMtk3amRvt+pKwI4ATmdq/GW81/WoWXhMvRLJVLJS9HR+xt0Vn0uQUw= Received: from CH0PR10MB4858.namprd10.prod.outlook.com (2603:10b6:610:cb::17) by MN2PR10MB3232.namprd10.prod.outlook.com (2603:10b6:208:126::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Wed, 19 Jan 2022 16:18:11 +0000 Received: from CH0PR10MB4858.namprd10.prod.outlook.com ([fe80::241e:15fa:e7d8:dea7]) by CH0PR10MB4858.namprd10.prod.outlook.com ([fe80::241e:15fa:e7d8:dea7%9]) with mapi id 15.20.4909.008; Wed, 19 Jan 2022 16:18:10 +0000 From: Chuck Lever III To: Bruce Fields CC: Jonathan Woithe , Linux NFS Mailing List Subject: Re: [PATCH 1/2] lockd: fix server crash on reboot of client holding lock Thread-Topic: [PATCH 1/2] lockd: fix server crash on reboot of client holding lock Thread-Index: AQHYDLbN5l3eHxKrf0S5rkJdvCtsdaxqht8A Date: Wed, 19 Jan 2022 16:18:10 +0000 Message-ID: <6349BB98-FB18-4ABC-A893-1CCB1E5CA3E5@oracle.com> References: <20220114103901.GA22009@marvin.atrad.com.au> <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> In-Reply-To: <20220118220016.GB16108@fieldses.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3654.120.0.1.13) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ddb9f65-8bac-4d20-11dd-08d9db674970 x-ms-traffictypediagnostic: MN2PR10MB3232:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:765; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OYoEr3ehvagb2XIEooETqoCYZrjSbulj5Xn5V79xmgGf7eIQ5XJovFLy47O6YkJx2zvLMe3xbBgclF4z+TQ282lt0J3ITa6dnZExNohE8zkasZbAuM7tmpZeXQr82aV8NuvHHjrQJl8ZG340qM0znCvedKDM2NguIQkSW+PCnvncfiq9A4vXO4xGoyejnPq3S/LQfYAKOphsnE03yXVoeGPdSVMBMj3GXMz0aFZvkmtNhizbUnFnF88Tox/d+5hNtEcddwvuEThvwzr0UVeCkkCHBHa/dLtumQ2L3SdZ8344+lkxRfLD8cQEknRriAz4xNvhf6t8aUSveSX5fKHnAAv2LVbe/gKeOyhNUkYVWjivihL0sE4bL3f9/990crcY2tWADEUxoxv2sAqWG7219oQuSndM+r37/Hk7SWYAew0JyYUzWNDkijPMc8Ull8nEnsSeujgpThry09lRWd1bX0/C9CHVtYV3zPEliVgl5vK7/OUY7tE7ofoIX36/oc38+CZb7rQYXEvO3ykL94ipXBU+vblGtinedjZlE/zTKqqRY/6hoZZtagIBmwQcN5Vj2Vm/q+AJ1rEF2+j5Nz+GbyRYTGFIpTMI45FBamkOIGfX0EkqKcnGEUlp2SbEnW8cnkBRFxmxa/TbYnPPv3g1AUsHNwEZW7HkWa/Fw4vaKqHLaM6kxMbBWA73D2D8rROV5FzVvBtOuo0tlxSXa23Y7KwH2EKtBdvInVGfrMuOndQrakSI0fovaApXAVqXaXkY x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB4858.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(71200400001)(83380400001)(53546011)(54906003)(5660300002)(33656002)(6512007)(66476007)(6506007)(8936002)(38070700005)(2906002)(4326008)(316002)(36756003)(186003)(26005)(38100700002)(2616005)(122000001)(76116006)(8676002)(6486002)(6916009)(66946007)(66556008)(66446008)(64756008)(86362001)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qWjfwlczhKG6l3vPSBsI+YnArihvqWp6g3U/uI1eaeWvR0OHk/4Zurebsh9P?= =?us-ascii?Q?yzTLUIWFJCj//tKRRsaSF7NjNBc6GjS0fJX7aJhq0f5fhM6ugfsIa4q0deDf?= =?us-ascii?Q?i5TGrjybVEtXsNp2oXLlS9RO6JDYkI70fMnw4LykylCoByaVclqVIZuKzm5h?= =?us-ascii?Q?ciIkQFcthgweN+E67EHzE75hRmc980xSrbUmyfK48gn2jzW9p1B7HlY6YJWR?= =?us-ascii?Q?Q1MVRhq3hhLptYG/Hbf3EtY8C0ie4q1wk50+2t6UAOMquAdtyrNM/4RrcIWe?= =?us-ascii?Q?VYz3mbrv0N7DEYiZeectHivSzpVdB9HLOl1DO7bBvfdxR1wpQUuYjqJwtRPm?= =?us-ascii?Q?uplGznh/UNkQ89Ua+q3I3zVKeg/jX8kc+3/udg+iSASbxWY2t3W8+Is/pYk+?= =?us-ascii?Q?UOehyjjPyn/i8XOH5iSDXnzLcMWQhT6W9SwQPSaj/wCijy8PYtS6efHjBm/M?= =?us-ascii?Q?Jhgc5Lk02yFiWicNzRzsdEmHIXzF99q/cgvNx5V+usWtnQh73ne0KpfOrIJk?= =?us-ascii?Q?ppzPSLmNUlkj62nE8pxG0NE8IwhB7eTuzkyozIuqfDesQF6pDAT5nTEGpiMV?= =?us-ascii?Q?2mbWP/PRTzWSgpZHwUrvCbuVYu9S7ketm+5qHh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s5oeMt/2/FCjo+dZdxKQmPzpBfDkiz5gHgNtEVn6B8bzKeXLGr0gr43i+kS?= =?us-ascii?Q?eYXvX+tJ9aZElkGERu2+ADLw/nfIV107xrdV6v5KfbHhPBn8nicBhGxkN1yh?= =?us-ascii?Q?tqW0sA5Bn6reaJVEvpNYi4I=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: <3840395BEB22B94DB7B2BB93ABFF0115@namprd10.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB4858.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ddb9f65-8bac-4d20-11dd-08d9db674970 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2022 16:18:10.9050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BpkU6VeZZoEp6klfBDG5AxK/wZI34D7j0p1OI44j0+Sh/qRy/+hA4XAkaGJL/lfj4Hr/bBt79Jll8B7yHwDWHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB3232 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10231 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201190092 X-Proofpoint-GUID: V29crvpbN5ZYx2oqg2o_evRyxfk4xJT3 X-Proofpoint-ORIG-GUID: V29crvpbN5ZYx2oqg2o_evRyxfk4xJT3 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Jan 18, 2022, at 5:00 PM, Bruce Fields wrote: >=20 > From: "J. Bruce Fields" >=20 > I thought I was iterating over the array when actually the iteration is > over the values contained in the array? >=20 > Ugh, keep it simple. >=20 > Symptoms were a null deference in vfs_lock_file() when an NFSv3 client > that previously held a lock came back up and sent a notify. >=20 > Reported-by: Jonathan Woithe > Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") > Signed-off-by: J. Bruce Fields > --- > fs/lockd/svcsubs.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) >=20 > diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c > index cb3a7512c33e..54c2e42130ca 100644 > --- a/fs/lockd/svcsubs.c > +++ b/fs/lockd/svcsubs.c > @@ -179,19 +179,20 @@ nlm_delete_file(struct nlm_file *file) > static int nlm_unlock_files(struct nlm_file *file) > { > struct file_lock lock; > - struct file *f; >=20 > lock.fl_type =3D F_UNLCK; > lock.fl_start =3D 0; > lock.fl_end =3D OFFSET_MAX; > - for (f =3D file->f_file[0]; f <=3D file->f_file[1]; f++) { > - if (f && vfs_lock_file(f, F_SETLK, &lock, NULL) < 0) { > - pr_warn("lockd: unlock failure in %s:%d\n", > - __FILE__, __LINE__); > - return 1; > - } > - } > + if (file->f_file[O_RDONLY] && > + vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL)) > + goto out_err; > + if (file->f_file[O_WRONLY] && > + vfs_lock_file(file->f_file[O_WRONLY], F_SETLK, &lock, NULL)) > + goto out_err; > return 0; > +out_err: > + pr_warn("lockd: unlock failure in %s:%d\n", __FILE__, __LINE__); > + return 1; > } >=20 > /* > --=20 > 2.34.1 >=20 Hi Bruce, thanks for the fixes. They've passed my basic smoke tests. I've applied both patches for the very next nfsd PR. See: git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git for-next -- Chuck Lever