From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42FE63A8747; Wed, 13 May 2026 05:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778651788; cv=none; b=m+X0qJuCZ6aZ+CiT35d/Fdi3yF7iEgGp7+C5aj3WTuk7wBC3Z1bnL4Z/eV7vwlEuvheSqT0tsSeOYrBs6tdFBlmoSWq5wj7XiRiA8MKcx+pTklxcREVtWRtskGHbtLo5ItJx1MetNpqbyzBtpe4NkzG2Vd9++sKxBENGVTwMzE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778651788; c=relaxed/simple; bh=s+h37/IOBmcvhCEzcH/fk+Et7jvVkVJRpnwV7+Hslrg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dFmvYHU5Su486fGMdo7feAfsIUnimECjTJwwMFxHFvnXdHo60fBH8MbI6u9XmAXId4R0P7RS9rE0LChYUVezfrw9leBjdLJc3b/W4QLoAZIUNzlV8LBAts3F1pNLezJlylX50+cHNuxXthBlBQ1y5GRY1zhvCVUSIFjgHw58mVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 693FC68BEB; Wed, 13 May 2026 07:56:22 +0200 (CEST) Date: Wed, 13 May 2026 07:56:22 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , Andrew Morton , Chris Li , Kairui Song , Christian Brauner , Jens Axboe , David Sterba , Theodore Ts'o , Jaegeuk Kim , Chao Yu , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Steve French , Paulo Alcantara , Carlos Maiolino , Damien Le Moal , Naohiro Aota , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org Subject: Re: [PATCH 05/12] swap: cleanup setup_swap_extents Message-ID: <20260513055622.GA1236@lst.de> References: <20260512053625.2950900-1-hch@lst.de> <20260512053625.2950900-6-hch@lst.de> <20260512164308.GF9555@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260512164308.GF9555@frogsfrogsfrogs> User-Agent: Mutt/1.5.17 (2007-11-01) On Tue, May 12, 2026 at 09:43:08AM -0700, Darrick J. Wong wrote: > > diff --git a/mm/swapfile.c b/mm/swapfile.c > > index 651c1b59ff9f..1b7fc03612f4 100644 > > --- a/mm/swapfile.c > > +++ b/mm/swapfile.c > > @@ -2783,25 +2783,24 @@ static int setup_swap_extents(struct swap_info_struct *sis, > > { > > struct address_space *mapping = swap_file->f_mapping; > > struct inode *inode = mapping->host; > > - int ret; > > + int ret, error = 0; > > /me wonders why not reuse ret instead of declaring a new variable? Because when I wrote this, the setup methods could still return a positive number of extents value that must not be clobbered. Since then I added patches before this that removed that, so we can use the same ret variable. From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E766CD4851 for ; Wed, 13 May 2026 05:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o+u8ejSMsTBYehhA0NfXB0k6zwz29Xak5Yy1nvO5plQ=; b=WUxLQfoeTt5pCQ6J037gmyo9X1 EFQCf3I5pqNuNM4AuIMJjfkoNGTxDlCii7+Q/GbkjBsiHpUYA8PwdKsDIwhpKVucyBPhLSAGO0AoP D6dfm9xwx6TjQrWgrhxq0PEBsk+0HLJso7aH0Qe6ZiZGRtKM7Tl8JC5SjhOO6ImjehDc=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wN2aB-0004Tj-Oy; Wed, 13 May 2026 05:56:33 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wN2aA-0004Tb-PM for linux-f2fs-devel@lists.sourceforge.net; Wed, 13 May 2026 05:56:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v5TCj2cJ/ZZjo4hdIuBCz/5ReUhnh72x/ISsIQifvmo=; b=VgxSGK//VPPY8+KDhBnRxaNr4k Yow8M3gaOVNUDARybZGKhMVxjX4hZsTOLUDYH3bUCHZCEOSdsB5LIEmNX8ZOH340bl3cKcrt+Wmxx sMN6yGlEb8sHEDO+/KhBHtjfyDpe7cf6ut9MOVK6baFgf4hX9aW1oixrArbaZa8meQkY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=v5TCj2cJ/ZZjo4hdIuBCz/5ReUhnh72x/ISsIQifvmo=; b=HajIh7bPnzNgZJuposLOXd3Tk0 b6M3AalutTOEfuiLkNrWyGhlzfqtuP3RnR4d0ha8Us4FkziA3kF6EA6wtPzl/qNy7fNHS5eHOr4aO IK2hfR9x8vIl1L6eMypWqw7aYZJl7iwYJRL9MQ4wqfzYQf+T78WcObrk8iSpS835zVTQ=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wN2a6-0005Ed-Ab for linux-f2fs-devel@lists.sourceforge.net; Wed, 13 May 2026 05:56:32 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 693FC68BEB; Wed, 13 May 2026 07:56:22 +0200 (CEST) Date: Wed, 13 May 2026 07:56:22 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Message-ID: <20260513055622.GA1236@lst.de> References: <20260512053625.2950900-1-hch@lst.de> <20260512053625.2950900-6-hch@lst.de> <20260512164308.GF9555@frogsfrogsfrogs> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260512164308.GF9555@frogsfrogsfrogs> User-Agent: Mutt/1.5.17 (2007-11-01) X-Headers-End: 1wN2a6-0005Ed-Ab Subject: Re: [f2fs-dev] [PATCH 05/12] swap: cleanup setup_swap_extents X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paulo Alcantara , linux-doc@vger.kernel.org, Carlos Maiolino , Hyunchul Lee , linux-mm@kvack.org, Christoph Hellwig , Naohiro Aota , linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, Namjae Jeon , Chris Li , linux-nfs@vger.kernel.org, linux-block@vger.kernel.org, Damien Le Moal , David Sterba , Jaegeuk Kim , Jens Axboe , Christian Brauner , Kairui Song , Theodore Ts'o , linux-cifs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Steve French , linux-btrfs@vger.kernel.org, Anna Schumaker , linux-fsdevel@vger.kernel.org, Andrew Morton , Trond Myklebust Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Tue, May 12, 2026 at 09:43:08AM -0700, Darrick J. Wong wrote: > > diff --git a/mm/swapfile.c b/mm/swapfile.c > > index 651c1b59ff9f..1b7fc03612f4 100644 > > --- a/mm/swapfile.c > > +++ b/mm/swapfile.c > > @@ -2783,25 +2783,24 @@ static int setup_swap_extents(struct swap_info_struct *sis, > > { > > struct address_space *mapping = swap_file->f_mapping; > > struct inode *inode = mapping->host; > > - int ret; > > + int ret, error = 0; > > /me wonders why not reuse ret instead of declaring a new variable? Because when I wrote this, the setup methods could still return a positive number of extents value that must not be clobbered. Since then I added patches before this that removed that, so we can use the same ret variable. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel