Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp46456rwb; Wed, 9 Nov 2022 19:39:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM6ylfnqqGrwc6JHLfFeHWjf4ycrOVpTDzACPb4OGu/ghsXwzfZWyNba7DrapnyC3TbA8u6k X-Received: by 2002:a17:906:1251:b0:78d:42b8:2dc2 with SMTP id u17-20020a170906125100b0078d42b82dc2mr2137475eja.608.1668051560921; Wed, 09 Nov 2022 19:39:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668051560; cv=none; d=google.com; s=arc-20160816; b=QaXXSUsMcu57SVmigKQ+mG+IXn5bRtgEbim5K/ANgBRsQFKf+aUEWyeo+nmY6N6m3F oTdCZBGsbfPPFS48Y6y/RAVCMXcvrZupOxDBa44vEbW55UNJDC4E8nVu1ThRa0H9LUC1 G7QHFPYWrpNrkhxQfJ2wt05bS/VUu8mRyWEeZlvRMaKzALxJoUlNKAPWj/IJ74+Xjw6M 0ok7fQHji38De05awxjZK0+B+CXZTEidBMdS1GxRLfWmeb7DkrY1UzCoTYvFEbwqnb5S AhN6t3MTfERoKOzyhpS6pbZ2/fxWUTUQPoO/1Ehv5CLm3Zo5tFvzhv9jygahrpOhl4xa Mz5w== 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=ImFeFDYsXMyLunch28/Ff8jR4Jwu5RmwIqBQ6vLGVc0=; b=dvbZWP/46XVJjd+KL3vHKq/4knxBcFriu7iCqv7sppAghEUTEXvEWb/zD2ZLbPCQdz SpApWu41vdo5yz3sI3vUiq9pGhWJgKn+OrWDByjt1oiguiO5ubqY9rPNQNLaHZrzudP7 P+WL/ehBctp7cRw1xCtQn7ROGuKBV16Yh99dHS0AibhcwNzHFuWiPuKwbuuZbhwVQxdP A3XI6kqj/ynzauMHeLaZk+OmCETJQ6zd9Iq9p2J++KpyPHFyC+JQI2hnJNYWT/XKSyf9 OCBq7W/gnLWkS82W+RJM/3edT9xIj+6BJHGbakQiiPmsr4dgXZDMP11utxZQeMr8BhLQ Dkjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dRaz9vRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a056402350600b004661ece3fabsi18937389edd.575.2022.11.09.19.38.58; Wed, 09 Nov 2022 19:39:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dRaz9vRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbiKJDNW (ORCPT + 92 others); Wed, 9 Nov 2022 22:13:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbiKJDNU (ORCPT ); Wed, 9 Nov 2022 22:13:20 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 541CD1EEE8; Wed, 9 Nov 2022 19:13:19 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id u6so414011plq.12; Wed, 09 Nov 2022 19:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ImFeFDYsXMyLunch28/Ff8jR4Jwu5RmwIqBQ6vLGVc0=; b=dRaz9vRVAYvShoIJ09oknHoIh+W1Y7xjhgNT5ylWjuT9QyXtFvwK1zOckMEx3K0vGS 9jH4bqTLLa1QvUGiASffucoR2Rz+a1B6U4r3Ls1jA+gLrdaHN1K2hLIIk9V1sjyU83d0 9qGLIKyl8WxBM9fGmNsoO3RenC0qUsRorrY2MCH2MOCAwzZKTrt+Z85Xep9N6PRFk4Jx XY22NKFo+Ep1XW9xuFOk6fRJnZBH2B0PzIdzJNbbwVe1i9ciQ90lRAjuSMmSw0zb6KtK cxxpWmA6Yih5fhvsST0RnnAWz3V7idyMsNsiKGqVFkdG8COD1AP1GB4x6rG/y65u34jT bYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ImFeFDYsXMyLunch28/Ff8jR4Jwu5RmwIqBQ6vLGVc0=; b=LOpvhcN+xd9YTL7oCKJLLCGKiclkuXI7Sjs0KhjKLjmkLRXZ34yXCxQXFbieFOyB8N S5F+ik+ND95FMzzOmbLp+VMr822ZdzstawgMxP+gQyE3IEZzLyqwyTypgBKySoIwfbqX rWXkwNprlgudztNrev5iK2F6PR5aTPqymGzK6LSYF0ZjtLXQgzhAJd/UQLC2E69BqObF F+jlGkxjg0ZkEkAUPt33pclvQRhLMEWI2j2K5vxJBV9WIistrMqCUGGTrIXUIcLeNmqn WMl0MWXE1xOmc1qPcJEXTOSgsjM7EIUuzNUUZv1S8LVwE8iHp+BQ69ZCEAmvEg62IC67 nsLg== X-Gm-Message-State: ACrzQf0UKkHS1QSf8CDP+oiCzzcxvpNgkLklD98MEL8/uOhmMrn9baOE 0d7r/0gjOY6DqozTQPpxWow= X-Received: by 2002:a17:90a:e606:b0:212:f100:22e3 with SMTP id j6-20020a17090ae60600b00212f10022e3mr83094466pjy.83.1668049998899; Wed, 09 Nov 2022 19:13:18 -0800 (PST) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id u7-20020a63ef07000000b004393c5a8006sm8179466pgh.75.2022.11.09.19.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 19:13:18 -0800 (PST) From: Miaoqian Lin To: Xiubo Li , Ilya Dryomov , Jeff Layton , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linmq006@gmail.com Subject: [PATCH] ceph: Fix NULL vs IS_ERR checking in ceph_getattr Date: Thu, 10 Nov 2022 07:13:10 +0400 Message-Id: <20221110031311.1629288-1-linmq006@gmail.com> X-Mailer: git-send-email 2.37.3.671.ge2130fe6da78.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ceph_lookup_inode() function return error pointers on error instead of NULL. Use IS_ERR() to check the return value to fix this. Fixes: aa87052dd965 ("ceph: fix incorrectly showing the .snap size for stat") Signed-off-by: Miaoqian Lin --- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4af5e55abc15..bad9eeb6a1a5 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2492,7 +2492,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, struct inode *parent; parent = ceph_lookup_inode(sb, ceph_ino(inode)); - if (!parent) + if (IS_ERR(parent)) return PTR_ERR(parent); pci = ceph_inode(parent); -- 2.37.3.671.ge2130fe6da78.dirty