Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2128000rdd; Thu, 11 Jan 2024 23:13:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJXoA/San5mRyyKuNQpHBBaJwT2dlx6lw9LH0GRu82iM6x98ma+dCZEUZxKoYVl+rRGIWe X-Received: by 2002:a05:620a:6217:b0:783:29b6:dfed with SMTP id ou23-20020a05620a621700b0078329b6dfedmr895367qkn.53.1705043587008; Thu, 11 Jan 2024 23:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705043586; cv=none; d=google.com; s=arc-20160816; b=j2E2zDaWg92P3sHYD+kyBbzLAT75zNRAZ3ElaISgplRrqfOHtl8alIsfK6my6J1VMN brJvSYqVqgntKPCCFURVKhJlqDYtGtbcEOvNSfYTSZLEtlPT46rbQ+EDsEEE1DARlEf4 o2YOvtWQHiTxvzyg1LzA26EZxa9C2PjMPDI5PJm+BSlikaljGPGwJRLjtnMpvFZTv/cS 0mUOhUednwOvrWxnhOpvjTndfjCCJL+CpnwmgJ/B+J6etgkVRQjF3Hse92Ra1cQfcvHd 6uMoR3gfw+0R69IXKJojfB/ZUJdWlSgsGO75qkPK/eUYNXOwADrkT17D+GWhtnfrLZUe cPUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=VCEqIivkHRIrYsw4MOEaXLZlutGhQyNEOuISiki+wOM=; fh=ZxZfyBbTNq11Zz9FNevqLHTCkzYztNbgJSuKfYIGzXM=; b=njM0SMX9ArqJnPbp1HBLgLc6iQC12rfigwYKy8lYxu5MCsHskOUAgVwPUgq6fXe4Nr gRTtDQlrH6/PQ/yODFvvsPHUb8H4KtnuqGZ+HAkRg0SUfmfsJTqHZ6TkATTsCwbZYFAv pQS2URy9ESxiLU6Nr6ZXrls+EwAlqd2GU+5lV+O/lKrj9IMh76YW3scblCp+b2m/CwW4 2DtYDl1MrHTjiWUatW0Q0FoG101sQNUfMpq5YQiBCosL751JebfQd8Lgfmwh2v69f5d9 LSsj6fXAAY2h9hIpk3qBNx+yt02Eexmxd5mmn1IBtL7mnTY0kTUYzc///VLPl7mF3BXc TNyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="W2B/Y4R4"; spf=pass (google.com: domain of linux-kernel+bounces-24358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24358-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dt28-20020a05620a479c00b0078321d7f0d5si2366518qkb.80.2024.01.11.23.13.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 23:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="W2B/Y4R4"; spf=pass (google.com: domain of linux-kernel+bounces-24358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24358-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BE5811C234FB for ; Fri, 12 Jan 2024 07:13:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A64695D726; Fri, 12 Jan 2024 07:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="W2B/Y4R4" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 19BB45C900 for ; Fri, 12 Jan 2024 07:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VCEqIivkHRIrYsw4MOEaXLZlutGhQyNEOuISiki+wOM=; b=W2B/Y4R4AIGJarjY9sQq+lbTg7 pqy5MthOXo0dJ1LTA4vrqeusN7lE70iX9dKDy5UTb7u31UkcQdzjpV+NIv19GbcENjkjQpsnDGu/K NVnI0M1bSS8WMMwupiu+VZapWMag7LrIehc0IWqTDeMev0+JreCdd/uJR0kSAyvRZaZ3+QeJjvLVG 6AF1r5uLxS6AdEbaMEsfnLiAJcICBjI0FkhpmIIChPCLRlgMVEE0/cUz6S23h1rwv+93cS4tdTYZQ Y0KFmHsbeNZQ3eTcDXGCPLBLMNNebOc1OELp4DwVB6bMnw8CY5Lfd4VqhuZiSdiyGQZFLd2oeYL1w 6Imo4YMg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rOBic-00E5Wm-1r; Fri, 12 Jan 2024 07:12:42 +0000 Date: Fri, 12 Jan 2024 07:12:42 +0000 From: Al Viro To: Linus Torvalds Cc: Jaegeuk Kim , Linux Kernel Mailing List , Linux F2FS Dev Mailing List Subject: Re: [GIT PULL] f2fs update for 6.8-rc1 Message-ID: <20240112071242.GA1674809@ZenIV> References: Precedence: bulk X-Mailing-List: linux-kernel@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: Sender: Al Viro On Thu, Jan 11, 2024 at 09:05:51PM -0800, Linus Torvalds wrote: > On Thu, 11 Jan 2024 at 10:28, Jaegeuk Kim wrote: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git tags/f2fs-for-6.8-rc1 > > Hmm. I got a somewhat confusing conflict in f2fs_rename(). > > And honestly, I really don't know what the right resolution is. What I > ended up with was this: > > if (old_is_dir) { > if (old_dir_entry) > f2fs_set_link(old_inode, old_dir_entry, > old_dir_page, new_dir); > else > f2fs_put_page(old_dir_page, 0); Where would you end up with old_dir_page != NULL and old_dir_entry == NULL? old_dir_page is initialized to NULL and the only place where it's altered is old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page); Which is immediately followed by if (!old_dir_entry) { if (IS_ERR(old_dir_page)) err = PTR_ERR(old_dir_page); goto out_old; } so we are *not* going to end up at that if (old_is_dir) in that case. Original would have been more clear as if (old_is_dir) { if (old_dir != new_dir) { /* we have .. in old_dir_page/old_dir_entry */ if (!whiteout) f2fs_set_link(old_inode, old_dir_entry, old_dir_page, new_dir); else f2fs_put_page(old_dir_page, 0); } f2fs_i_links_write(old_dir, false); } - it is equivalent to what that code used to do. And "don't update .. if we are leaving a whiteout behind" was teh bug fixed by commit in f2fs tree... The bottom line: your variant is not broken, but only because f2fs_put_page() starts with static inline void f2fs_put_page(struct page *page, int unlock) { if (!page) return; IOW, you are doing f2fs_put_page(NULL, 0), which is an explicit no-op.