Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4831588pxb; Tue, 5 Oct 2021 11:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFtn87oGAglyqNxpbB+eFAZ1XRxqv+QHw0UL7uEgq4SstTPV/1A4Wc0IWSpEd9tkpzqFbg X-Received: by 2002:a05:6402:424a:: with SMTP id g10mr26562433edb.26.1633457614427; Tue, 05 Oct 2021 11:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633457614; cv=none; d=google.com; s=arc-20160816; b=z755uCetlkiXP4ONQ74kdZyli+2QauHAn9PCU1c3kW/R8lVdXsW6aFOGk5J4ZckWAn EtMuSlsvH0V/ZNjkIcx60lLEkCP/xDr1L99AVDPjrrjMtDDM3QELjfz/kRIgn4Gy7nPt 5ZqoNRaYjiUHEBE/Ao5YQHYyC3URCXNKBTXHgnOQ/DAIeKp4ZTU12Ld/WsuEN78rDwJx qnndjox5qGLL8K3T69pTZpO67CwGqSp+F1BdWxw2l3QMHD5fv+DKLYy31ebCHZE5vkNr HXI8RJvm9rxm8elrWUfkgqktYWnA7DXVVV+Y+XtalXOzwr4ey0tD6K5dmno/2uP9PKeb QVhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HNm2ZIyKhu8SMfyJqMObqe9ec+K92s9keLy4kI7AGrI=; b=DpuqrR+d7Bengl2AYLTEVqbiuHvKnqP0JFcYa32+fn7xUc2XieM0Vf9Kf+yCbXzgCW /JdU5zOUi/fP1Zie3JlE4REnECdLj1C6MNysuQwTNq6Rp/pcQ38t+b7ikGdp/7W2b5/k 8Nj7WbtBPNKLY2EDRtYjd0Y7sn4OFPa7WRxSVfTd3ZrkQa/irMO3Q7Xw2F05dQRCBOVY /eZ+TzQT+M+XYyLYiYgLxJcYNhwd322ulxACkmYIjjqU1q8N0m+2uzsp8+/GCC1C++f/ Ob3bxsvZvxEmnZu+8NpiZamMcCV/fFGIZCaOtjWe6DTQcekA76csvtzmLSH+Mwog3LNq oTLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UPKlaSd2; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si23934695ejd.683.2021.10.05.11.13.05; Tue, 05 Oct 2021 11:13:34 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=UPKlaSd2; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232861AbhJESOy (ORCPT + 99 others); Tue, 5 Oct 2021 14:14:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:40086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbhJESOy (ORCPT ); Tue, 5 Oct 2021 14:14:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A6A061159; Tue, 5 Oct 2021 18:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633457583; bh=uc8esn9ZMPvwSxFzpCt/uaOHVqQIh/+2smcRCBy2ewo=; h=From:To:Cc:Subject:Date:From; b=UPKlaSd2rBWcux55Xy2BuCgo4+pdL8KtP6E8p8O/UKEmqJDL1ot2Y9xT3OoV1nH/O PS04A9YFgAH03od66d0qytM9S20T5tAu+cvCFj/sJvvNdi99NaDNkEYqP1ozerWmmm 21vEGXQRMGZWZUQ9F2mX/FPGwDwoqaXvU/XCRuRmlhFpeVsN9YL/v9BSUqU9Gp39AB 29EgLQdysgyb/l5tXTdQwcC418Kzi2aOomleLAWrYZxxHRESGzMqBnhVd/bvM9HvHh 0Itl9TbRPpRPT6qLn08yOvbukBvBkD2xq6yoTORu7KKVL7x7JaGUxFWCt+sabzv5gA t72z/dY449fdg== From: trondmy@kernel.org To: Olga Kornievskaia Cc: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Fix an Oops in pnfs_mark_request_commit() Date: Tue, 5 Oct 2021 14:12:54 -0400 Message-Id: <20211005181254.1056348-1-trondmy@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Olga reports seeing the following Oops when doing O_DIRECT writes to a pNFS flexfiles server: Oops: 0000 [#1] SMP PTI CPU: 1 PID: 234186 Comm: kworker/u8:1 Not tainted 5.15.0-rc4+ #4 Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.13.0-2.module+el8.3.0+7353+9de0a3cc 04/01/2014 Workqueue: nfsiod rpc_async_release [sunrpc] RIP: 0010:nfs_mark_request_commit+0x12/0x30 [nfs] Code: ff ff be 03 00 00 00 e8 ac 34 83 eb e9 29 ff ff ff e8 22 bc d7 eb 66 90 0f 1f 44 00 00 48 85 f6 74 16 48 8b 42 10 48 8b 40 18 <48> 8b 40 18 48 85 c0 74 05 e9 70 fc 15 ec 48 89 d6 e9 68 ed ff ff RSP: 0018:ffffa82f0159fe00 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff8f3393141880 RCX: 0000000000000000 RDX: ffffa82f0159fe08 RSI: ffff8f3381252500 RDI: ffff8f3393141880 RBP: ffff8f33ac317c00 R08: 0000000000000000 R09: ffff8f3487724cb0 R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000001 R13: ffff8f3485bccee0 R14: ffff8f33ac317c10 R15: ffff8f33ac317cd8 FS: 0000000000000000(0000) GS:ffff8f34fbc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000122120006 CR4: 0000000000770ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: nfs_direct_write_completion+0x13b/0x250 [nfs] rpc_free_task+0x39/0x60 [sunrpc] rpc_async_release+0x29/0x40 [sunrpc] process_one_work+0x1ce/0x370 worker_thread+0x30/0x380 ? process_one_work+0x370/0x370 kthread+0x11a/0x140 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Reported-by: Olga Kornievskaia Fixes: 9c455a8c1e14 ("NFS/pNFS: Clean up pNFS commit operations") Signed-off-by: Trond Myklebust --- fs/nfs/pnfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index d810ae674f4e..a0f6ff094b3a 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -517,7 +517,7 @@ pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg, { struct pnfs_ds_commit_info *fl_cinfo = cinfo->ds; - if (!lseg || !fl_cinfo->ops->mark_request_commit) + if (!lseg || !fl_cinfo->ops || !fl_cinfo->ops->mark_request_commit) return false; fl_cinfo->ops->mark_request_commit(req, lseg, cinfo, ds_commit_idx); return true; -- 2.31.1