From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="NFO11Xyc" X-Greylist: delayed 417 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 06 Dec 2023 20:25:32 PST Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [IPv6:2001:41d0:1004:224b::af]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73CDD5C for ; Wed, 6 Dec 2023 20:25:32 -0800 (PST) Date: Wed, 6 Dec 2023 23:18:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701922711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2mvMz4Xtdgv0/4300WneKlj3cKdx36cdNrIcEspzdyw=; b=NFO11XycgEixh3ft6g48SeLb7yeXS3J4BErSklwsmCkY/vNLDM+uI54ppt0a97GslK3N9e vh/Hdk0XILHlX93REmLqe4QAbbVtBqUPa6B3yxXoX9OOcTZoRfm5eTauUVSFjjARyChQf0 c0CpqzY4BCG20/1m7mZGJapZt1QRhfw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-cachefs@redhat.com, dhowells@redhat.com, gfs2@lists.linux.dev, dm-devel@lists.linux.dev, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/11] vfs: Remove unnecessary list_for_each_entry_safe() variants Message-ID: <20231207041827.yn5d46g7lvz3d3um@moria.home.lan> References: <20231206060629.2827226-1-david@fromorbit.com> <20231206060629.2827226-3-david@fromorbit.com> Precedence: bulk X-Mailing-List: linux-security-module@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: <20231206060629.2827226-3-david@fromorbit.com> X-Migadu-Flow: FLOW_OUT On Wed, Dec 06, 2023 at 05:05:31PM +1100, Dave Chinner wrote: > From: Jan Kara > > evict_inodes() and invalidate_inodes() use list_for_each_entry_safe() > to iterate sb->s_inodes list. However, since we use i_lru list entry for > our local temporary list of inodes to destroy, the inode is guaranteed > to stay in sb->s_inodes list while we hold sb->s_inode_list_lock. So > there is no real need for safe iteration variant and we can use > list_for_each_entry() just fine. > > Signed-off-by: Jan Kara > Signed-off-by: Waiman Long Reviewed-by: Kent Overstreet