From patchwork Thu Oct 8 16:55:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7354261 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 068869F54C for ; Thu, 8 Oct 2015 16:55:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19FD92078D for ; Thu, 8 Oct 2015 16:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8571207E8 for ; Thu, 8 Oct 2015 16:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933270AbbJHQzf (ORCPT ); Thu, 8 Oct 2015 12:55:35 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:33851 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933722AbbJHQze convert rfc822-to-8bit (ORCPT ); Thu, 8 Oct 2015 12:55:34 -0400 Received: by qgez77 with SMTP id z77so47316435qge.1 for ; Thu, 08 Oct 2015 09:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=BZfeeUk5JH7b/my2ItDk+OvI0z80xhf8p12t7LZNK+M=; b=CNvC6L+0miC9uL7hIAEnJxEg7Ap5jXX3Fg5oTirRHa/BZFt1ElbfQRKCiqmdpEkecz 8DrWTAq+VaYc2S9BT8i8KmIMsBVCSUbK4t4X0Av5yBeQTanGDwWgW25vXa4pjjWDl+TB UdPCF2VY3utYejKYEpMZrfAC3GDLBPBdI1+LM2GDpSazuXm6DaYcM3SVCNvVo+ZJjEW8 wEwTLWs6Kouw/eRR1YJ/fWSb1ZzYgGIDSPq86no3oqFv3LTiYSKtw/GKuTViMwnQtYg8 ZjsvLrr3i6DBeAw5/uxLNkftcpMV+/Krx9Oh+tmuMJEFzJIjFAWLHWKoCu3eCMuhGddh K2rA== X-Gm-Message-State: ALoCoQnMHD87ECoMqdb+a/xfm5pq5w+qIvMkHy/HE41zH2kMPi9Ix3Y6/04AiI3Oc0PqyoZBIX0q X-Received: by 10.140.201.85 with SMTP id w82mr9913707qha.91.1444323333916; Thu, 08 Oct 2015 09:55:33 -0700 (PDT) Received: from synchrony.poochiereds.net ([2606:a000:1125:6079::2e2]) by smtp.gmail.com with ESMTPSA id h10sm19034948qgf.29.2015.10.08.09.55.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2015 09:55:33 -0700 (PDT) Date: Thu, 8 Oct 2015 12:55:29 -0400 From: Jeff Layton To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro Subject: Re: [PATCH v5 00/20] nfsd: open file caching Message-ID: <20151008125529.3f30308e@synchrony.poochiereds.net> In-Reply-To: <20151008164225.GA496@fieldses.org> References: <1444042962-6947-1-git-send-email-jeff.layton@primarydata.com> <20151008164225.GA496@fieldses.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 8 Oct 2015 12:42:25 -0400 "J. Bruce Fields" wrote: > I get a this on the client running some lease tests: > > [ 38.552120] BUG: unable to handle kernel NULL pointer dereference at (null) > [ 38.552723] IP: [] vfs_setlease+0x1f/0x70 > [ 38.553111] PGD 56c2d067 PUD 51145067 PMD 0 > [ 38.553534] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC > [ 38.554128] Modules linked in: nfsd auth_rpcgss oid_registry nfs_acl lockd grace sunrpc > [ 38.555102] CPU: 0 PID: 4890 Comm: lease_tests Not tainted 4.3.0-rc3-14186-g7619b8e #322 > [ 38.555593] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153950- 04/01/2014 > [ 38.556005] task: ffff880075bd8080 ti: ffff880055560000 task.ti: ffff880055560000 > [ 38.556005] RIP: 0010:[] [] vfs_setlease+0x1f/0x70 > [ 38.556005] RSP: 0018:ffff880055563e98 EFLAGS: 00010246 > [ 38.556005] RAX: 0000000000000000 RBX: 0000000000000002 RCX: ffff880055563ec8 > [ 38.556005] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff880051133e40 > [ 38.556005] RBP: ffff880055563eb8 R08: 0000000000000000 R09: 00007ffc941da360 > [ 38.556005] R10: 0000000000000008 R11: 0000000000000212 R12: ffff880051133e40 > [ 38.556005] R13: 0000000000000000 R14: ffff880051133e40 R15: ffff880051133e40 > [ 38.556005] FS: 00007fbbe6864700(0000) GS:ffff88007f800000(0000) knlGS:0000000000000000 > [ 38.556005] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 38.556005] CR2: 0000000000000000 CR3: 00000000590b0000 CR4: 00000000000406f0 > [ 38.556005] Stack: > [ 38.556005] ffff880056dd1f88 0000000000000002 0000000000000400 0000000000000002 > [ 38.556005] ffff880055563ef8 ffffffff811fd4c1 ffff880051133e40 ffffffff8157b913 > [ 38.556005] 0000000000000000 0000000000000000 0000000000000400 0000000000000002 > [ 38.556005] Call Trace: > [ 38.556005] [] fcntl_setlease+0xa1/0xd0 > [ 38.556005] [] ? security_file_fcntl+0x43/0x60 > [ 38.556005] [] SyS_fcntl+0x31f/0x630 > [ 38.556005] [] entry_SYSCALL_64_fastpath+0x12/0x6f > [ 38.556005] Code: ff ff 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 89 e5 41 55 41 54 53 49 89 d5 49 89 fc 48 89 f3 48 83 ec 08 48 83 fe 02 <48> 8b 12 74 14 48 c7 c7 40 cb 27 83 48 89 4d e0 e8 9c d8 e9 ff > [ 38.556005] RIP [] vfs_setlease+0x1f/0x70 > [ 38.556005] RSP > [ 38.556005] CR2: 0000000000000000 > [ 38.573673] ---[ end trace 2e6e1d4b9df8a11e ]--- > > --b. My bad...it needs this patch. I'll roll this into the set before the next posting. From 9f04033dcf00f7b252f03c8782795b6a1f847991 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 8 Oct 2015 12:53:54 -0400 Subject: [PATCH] locks: "lease" pointer can be NULL ...in which case we just want to skip the notifier. Signed-off-by: Jeff Layton --- fs/locks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/locks.c b/fs/locks.c index a2d5794d713a..4fccd3035842 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1835,7 +1835,8 @@ setlease_notifier(long arg, struct file_lock *lease) int vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv) { - setlease_notifier(arg, *lease); + if (lease) + setlease_notifier(arg, *lease); if (filp->f_op->setlease) return filp->f_op->setlease(filp, arg, lease, priv); else