From patchwork Wed Jan 3 08:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13509724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 770FEC3DA6E for ; Wed, 3 Jan 2024 08:42:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C09E8D0037; Wed, 3 Jan 2024 03:42:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 072D88D0035; Wed, 3 Jan 2024 03:42:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA2338D0037; Wed, 3 Jan 2024 03:42:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D878E8D0035 for ; Wed, 3 Jan 2024 03:42:15 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B4DC91C08CF for ; Wed, 3 Jan 2024 08:42:15 +0000 (UTC) X-FDA: 81637357830.11.1FB47CD Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf14.hostedemail.com (Postfix) with ESMTP id 1F99410000F for ; Wed, 3 Jan 2024 08:42:13 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="Uh/+t2WV"; spf=none (imf14.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704271334; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JhCgkrtHibPlII0BBIGAXVuHhyHzEnEyi2A+L2TpO4Q=; b=w2Wy5jxc6heMBT48ma+4onZNQCtWFWsFZ3XDsjkjkniSQ5XIrO0LM0kWfS1ezQh8ANrKuL UsLK1QaxtPveC2BR/sgZNirbiYp45OP1ICxupGk7dZPsjefRexa5z/9Xy5ZhFE8SEUq8m1 wCI64olzz048EFV+4xDCAjCK3mVmPmQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704271334; a=rsa-sha256; cv=none; b=RmI8fAbIqi1Jvah/pLMFRn/Yw3Q2aDKpg41qjV2CvrEROKldENU21dnDV+wJs451MeCdLa Aqp0JMSw02KTBLdgjilm9KZk2h9z0KDOtbTQwo0TGDazbPdgwRNoP1B9+9HRTCeMUoFoWk UkNcMH6b9nx0YtA1ecCTLZwVEEWrC9g= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="Uh/+t2WV"; spf=none (imf14.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=JhCgkrtHibPlII0BBIGAXVuHhyHzEnEyi2A+L2TpO4Q=; b=Uh/+t2WVVTHbFcu65yNj5HGXPK zr8p8kjN9KsH0QOA8lxX9z5fe+eeSKdYu7nQs3+OXY1A84yOx0Da7bKN0XNxHdLodl0526xyQ2EO+ rXJXZws2yBC2UGMDliAgkm1/CidU/9FYNm/TyF8zq+U74MB2lSSl8FLqZRT6aPkvn8/miiRalE9R+ eIZzGNoPa08YzIS5boiamaolADs2FaUaAXCf5txRfEGkBML26JrKk60OnIPuIAvpQn1Vf5P5E3546 UwDis5w7hc1hc3V+dNzVZh1fGq3zEZATbYEkryOpz1s6Ezt0mIoDvmJD/Of76BP87WeQjw3RAsF4h BAA367CQ==; Received: from [89.144.222.185] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rKwpD-00A6iS-2k; Wed, 03 Jan 2024 08:42:08 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/15] xfs: shmem_file_setup can't return NULL Date: Wed, 3 Jan 2024 08:41:18 +0000 Message-Id: <20240103084126.513354-8-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103084126.513354-1-hch@lst.de> References: <20240103084126.513354-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: wuek6fr9nt8qzw9mohd8dcs5yjse5efh X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1F99410000F X-Rspam-User: X-HE-Tag: 1704271333-27672 X-HE-Meta: U2FsdGVkX19AKp2T+UbsOIz4s2IJAGcvAPD1e4LSHqnEeN6bIZMoCnItecQgcsmpYwHDWnJtAb3aJRLpKUobmTw0WJY8UEyJFE4GKhM6Av+hTi2oUmgnlj/uSA/XBdXnRNerrDcWVIDSsNb9vsKR7GOcth/K2ZUkjWTcZLoKotEL8/Q5SkWd6lf4SMmx4gKQc/oQfycoSjlyNcnG6o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/8f02hx/BNdbKe+azDbKuXSTLRaryORwJ9BxhaGjf3Q67dvaGfPR4FZlYHGR4xz8mEDJhc+VsvlOR+lvI5DK/hTxdn8N483G7upfuTLekfHFaCFx4mlIKTHhWV+/+VHRP97TsB+3OH5g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: shmem_file_setup always returns a struct file pointer or an ERR_PTR, so remove the code to check for a NULL return. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/xfile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index 46f4a06029cd4b..ec1be08937977a 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -62,15 +62,13 @@ xfile_create( { struct inode *inode; struct xfile *xf; - int error = -ENOMEM; + int error; xf = kmalloc(sizeof(struct xfile), XCHK_GFP_FLAGS); if (!xf) return -ENOMEM; xf->file = shmem_file_setup(description, isize, 0); - if (!xf->file) - goto out_xfile; if (IS_ERR(xf->file)) { error = PTR_ERR(xf->file); goto out_xfile;