From patchwork Tue Apr 23 18:32:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10913663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86280922 for ; Tue, 23 Apr 2019 18:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79B9F2882E for ; Tue, 23 Apr 2019 18:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E61B2883D; Tue, 23 Apr 2019 18:32:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BE1D2882E for ; Tue, 23 Apr 2019 18:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbfDWScQ (ORCPT ); Tue, 23 Apr 2019 14:32:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:56656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfDWScQ (ORCPT ); Tue, 23 Apr 2019 14:32:16 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1748020693; Tue, 23 Apr 2019 18:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556044335; bh=Oi2aa6Ec1u8V5boxm8Ati9zPw/yxsBhG3YXXwblm4Lk=; h=From:To:Cc:Subject:Date:From; b=z0Tx9ayel2/8jtTo3kWS4f5v3yNyKpSdG3hHV0ttPk0xOSqfidbTVJMz3uXN6v/cD O8wbJ+VkXCkFwYf9UNqIkQWJkG8eRJptBhc1osAr11ZsjlZ7zwnTtymCZhNNZAr7r4 8i3ovN6rIoYvspCg6Bg/lkTrTdhwMO+tsnGOVTqM= From: Jeff Layton To: zyan@redhat.com, sage@redhat.com, idryomov@gmail.com Cc: ceph-devel@vger.kernel.org Subject: [PATCH] ceph: fix NULL pointer deref when debugging is enabled Date: Tue, 23 Apr 2019 14:32:13 -0400 Message-Id: <20190423183213.16003-1-jlayton@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP snapc can be NULL here. Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" --- fs/ceph/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 0e505a5e09fe..ccc054794542 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -928,7 +928,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, dout("sync_direct_%s on file %p %lld~%u snapc %p seq %lld\n", (write ? "write" : "read"), file, pos, (unsigned)count, - snapc, snapc->seq); + snapc, snapc ? snapc->seq : 0); ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + count - 1);