Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp458643rwr; Wed, 3 May 2023 00:53:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+8+EBivZFrAJ5dQcnPP4iG3d5k0afoEJ2h6nfme+xqXP2v13IviLPMLqe64kRwQb6xNKb X-Received: by 2002:a05:6a20:1604:b0:f6:5a75:7d44 with SMTP id l4-20020a056a20160400b000f65a757d44mr7531929pzj.12.1683100423543; Wed, 03 May 2023 00:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683100423; cv=none; d=google.com; s=arc-20160816; b=KEcTAL9F2PcI+mfmci7NXyooHSs3ScMlq92Qs+zOi0Qcyye/ZsbaGxroYc5Jj0ujXW Mjob9wyldFK+SWSSNlMhDhvwZ0mshk6ubjLai4/3P5DnlVgkEXLqY56Mk4sMwNHRKQxh s4/katwSFc1Pfhx3enXrF3IJyD6s05f1fb4V2vT09WjkzAxGgYwEtBfwevg4gvSsXkWX WmStpjN5iAg1XF45McdgG6Ej61k5nFSH8LPK1SLInsnl7BeHTvMTLDV5UO7XQMaWDilj AfL7vTMADplYAFDxAH4WBZf1KDWqili1RCIfdyE77hCda8IO/0K+ZEn1pVpc8rFgBkJZ vpDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=JLVZ2qr0aADxwht3HhrKMBGu5TWbkRKBfSfnYvYN75k=; b=mD39Ed+MP/HHvJrA5DdbESK7QlMD7KwAi0vRD6S+G6Xyf7ia1tPecjBvzr52lcUq6A fC2CrVjeUhh/8PBCWFt83IgltR/uSFiGbMmODPUhjTxxOK9MC1sXyyC7D9xfYCij9TXq BG6E5m7Hrt0aBmGaexyXS4GNcBhVxktufkV2EFAC8A5MTff80rK1keqh7jMWRXRIHgY7 7g8p6z43VJMHUQ8E020QxOmYSMTbUpDAQGSmVuxN/ZcFwXlmHbWO5Z+iUyM8+Q77xkCi YJMwYZEFtv4RFf4qJLBUzuhUlhk2+8YbK9zJDrfYGH9SiYGUW8awrfN8p+FzBAWOgu/Z 6knA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=jV4yOO4Q; dkim=pass header.i=@codewreck.org header.s=2 header.b=S73ApCJN; 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=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a634d4b000000b0052856cec94csi21904342pgl.877.2023.05.03.00.53.29; Wed, 03 May 2023 00:53:43 -0700 (PDT) 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=@codewreck.org header.s=2 header.b=jV4yOO4Q; dkim=pass header.i=@codewreck.org header.s=2 header.b=S73ApCJN; 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=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbjECHuB (ORCPT + 99 others); Wed, 3 May 2023 03:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjECHt4 (ORCPT ); Wed, 3 May 2023 03:49:56 -0400 Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 331A63C3C; Wed, 3 May 2023 00:49:54 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 78366C023; Wed, 3 May 2023 09:49:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1683100193; bh=JLVZ2qr0aADxwht3HhrKMBGu5TWbkRKBfSfnYvYN75k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jV4yOO4QsLylfiKRa07f0uak6kW/yEilPPdwH4NcdIUwtTUyO3yIUMpNWqXc7kXC5 k6ezhDZrrvjHzGzpBQ2Y9EzEJDGtFo/IVs8t7riTsKl0FzbyTqEGJxqa7Pgpcm3V0g HdumY7jHOjS/Zezvn33VNDC6blUsksP1uPQBxpMVl3ZN0xCLY8YNYwJI1QQAXt/Ujr 8bBXrJ5vdtVXDr8iqsMv+dSv/l4kgAf85Y9UeBmwfkByoHcJJ3XyGLeRiCjLGi43OC uwizkyxemtpA62dEe4HCIS9U7g2KcFyjBHkfUTjvJHOgcYF4XkJB6x0lK8ll9jIk+H GWaUq5R71aNxA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id C2E6BC01B; Wed, 3 May 2023 09:49:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1683100192; bh=JLVZ2qr0aADxwht3HhrKMBGu5TWbkRKBfSfnYvYN75k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=S73ApCJN611o1b3HAaqBGFo4q24SoUEsRPJnIcVNEF991guUmTu0NcSUEscdakiyA LCiDz8rM9Zg8WPnDBOxNBk2sRzXQhzXA2YlFFZMOVItzRnxw76HY7iC6EKXzF7+8sI Cto+uL6+P8B/6bPxrB0+n2car+BqyM7Xl0UhHbMYXclGK5fvODIBCi06D36QUCocmB IRRcx2+8vD7Qh8bXN7in030rOPYCAXab4KAu6tiSe5tjeRQcUuiuZawxK0mWhtwvx8 1PqqF5YiFASfQ9RpAqUEPoJo4qzLHwDUyCrdKsQ86BiMCy+3h1ZXFLLCXOTfeOVReI 6INwuviA9PFdQ== Received: from [127.0.0.2] (localhost [::1]) by odin.codewreck.org (OpenSMTPD) with ESMTP id fc1d14d5; Wed, 3 May 2023 07:49:37 +0000 (UTC) From: Dominique Martinet Date: Wed, 03 May 2023 16:49:25 +0900 Subject: [PATCH v2 1/5] 9p: fix ignored return value in v9fs_dir_release MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230427-scan-build-v2-1-bb96a6e6a33b@codewreck.org> References: <20230427-scan-build-v2-0-bb96a6e6a33b@codewreck.org> In-Reply-To: <20230427-scan-build-v2-0-bb96a6e6a33b@codewreck.org> To: Eric Van Hensbergen , Latchesar Ionkov , Christian Schoenebeck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dominique Martinet X-Mailer: b4 0.13-dev-f371f X-Developer-Signature: v=1; a=openpgp-sha256; l=1482; i=asmadeus@codewreck.org; h=from:subject:message-id; bh=0Kq8S/nnqbpqwe978W0kzTTDeACeZdS8gRGbd2pgoBE=; b=owEBbQKS/ZANAwAIAatOm+xqmOZwAcsmYgBkUhIRABowPIT/YRnhXuUjF/JKwf1Rhl8HnsZ3d RAj/XP3goqJAjMEAAEIAB0WIQT8g9txgG5a3TOhiE6rTpvsapjmcAUCZFISEQAKCRCrTpvsapjm cDqZD/9qztEcOW4BpCi02ViD151aL+3siB2XfsyF95CQjJMkFTzuDLB7SOA2U87gnE33YLj0LsD l8oB1n9tGObYUxQnpCbHe+VpuV17GKjjqufv/LVfBlEiY31zE9Me6NfEJEfuCk12yufD0ZXxn35 dZuPv91FmF7nyAvnqOROvKR7R0FVuUEODkXWtpeExcOi2OxtxAkc8aSNiZKPTB+Q0cdQvq7XDGI 4chlb83pSqstnJ1N4qWhco8lr8s+Wln3mb4BAhMYljrDiv0dKeiIPv94ARu2iFbzVpFBgG7kooW 2dMWhyn7xqpRML/FlQZE+pQjzzTbjyBSMzqehmlKNR3AF2qyDcPNlzi757KAlgYVQXus+QqQDa0 2Hl8fh+rLFNkbQ6cQB1BrwnMLi2p1lq0TttJ2DqUfSnFptxU0C8TGYINtGUCDd8TATWXd3kHGw8 KXFGKvnce/arS9E0l2uB9y4DzXvHg5TK2bXrHiLWpWYX+e2WCMWgdZWbOC7LWHv0hExPuSAEnlJ EAxiApQezhQMY9fo4mB3Bdhq3RHFG2jusW4H9c2toT2qBnBV+ZccQAcinul9y1MHIgV6mwKhcoO Pw4NPf8VkmjYJTZ60RH9HZBIvqZPLWoc90hszRp/Aah4hOlWk4KN1rHXagWPzTLrMzj+dInSjiY T3mHOzvkCMwdZHQ== X-Developer-Key: i=asmadeus@codewreck.org; a=openpgp; fpr=B894379F662089525B3FB1B9333F1F391BBBB00A Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org retval from filemap_fdatawrite was immediately overwritten by the following p9_fid_put: preserve any error in fdatawrite if there was any first. This fixes the following scan-build warning: fs/9p/vfs_dir.c:220:4: warning: Value stored to 'retval' is never read [deadcode.DeadStores] retval = filemap_fdatawrite(inode->i_mapping); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: d9bc0d11e33b ("fs/9p: Consolidate file operations and add readahead and writeback") Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet --- fs/9p/vfs_dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 289b58cb896e..54bb99f12390 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -209,7 +209,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) struct p9_fid *fid; __le32 version; loff_t i_size; - int retval = 0; + int retval = 0, put_err; fid = filp->private_data; p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n", @@ -222,7 +222,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) spin_lock(&inode->i_lock); hlist_del(&fid->ilist); spin_unlock(&inode->i_lock); - retval = p9_fid_put(fid); + put_err = p9_fid_put(fid); + retval = retval < 0 ? retval : put_err; } if ((filp->f_mode & FMODE_WRITE)) { -- 2.39.2