{"id":2228336,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228336/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260426061009.GQ3518998@ZenIV/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/1.1/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260426061009.GQ3518998@ZenIV>","date":"2026-04-26T06:10:09","name":"why does ext4_sync_parent() bother with d_find_any_alias() at all?","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5ed9092e1cbd7535ff5829b5c5c4631ab562cee2","submitter":{"id":583,"url":"http://patchwork.ozlabs.org/api/1.1/people/583/?format=json","name":"Al Viro","email":"viro@ZenIV.linux.org.uk"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260426061009.GQ3518998@ZenIV/mbox/","series":[{"id":501502,"url":"http://patchwork.ozlabs.org/api/1.1/series/501502/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=501502","date":"2026-04-26T06:10:09","name":"why does ext4_sync_parent() bother with d_find_any_alias() at all?","version":1,"mbox":"http://patchwork.ozlabs.org/series/501502/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228336/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228336/checks/","tags":{},"headers":{"Return-Path":"\n <SRS0=tQXA=CZ=vger.kernel.org=linux-ext4+bounces-16101-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.a=rsa-sha256\n header.s=zeniv-20220401 header.b=OlCHV83d;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=tqxa=cz=vger.kernel.org=linux-ext4+bounces-16101-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk","gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.a=rsa-sha256\n header.s=zeniv-20220401 header.b=OlCHV83d;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16101-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk\n header.b=\"OlCHV83d\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=62.89.141.173","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk","smtp.subspace.kernel.org;\n spf=none smtp.mailfrom=ftp.linux.org.uk"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3GX30n2Bz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 16:10:25 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g3GWy6RWyz4wSS\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 16:10:22 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g3GWy6DGBz4wSp; Sun, 26 Apr 2026 16:10:22 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g3GWr3Hzmz4wSS\n\tfor <patchwork-incoming@ozlabs.org>; Sun, 26 Apr 2026 16:10:16 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 6C62C300B626\n\tfor <patchwork-incoming@ozlabs.org>; Sun, 26 Apr 2026 06:10:12 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 4DE212C0F6D;\n\tSun, 26 Apr 2026 06:10:11 +0000 (UTC)","from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id D3F76199FB0;\n\tSun, 26 Apr 2026 06:10:07 +0000 (UTC)","from viro by zeniv.linux.org.uk with local (Exim 4.99.1 #2 (Red Hat\n Linux))\n\tid 1wGsgz-00000004Hq9-1D63;\n\tSun, 26 Apr 2026 06:10:09 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777183822; cv=pass;\n\tb=G6fK3kn7rmoG/uPjxKRON9f6zHGUtXVQQwI/oR4M2jHy6din0DGs78Cza/DyZtsnvpuPwT4h9MW2P7uNh1K6kJTCfg+rDWvYs2DF3lkiNHMMbwo7c306QogeGEgFUB01EG/i10n2gbM4cI/5Qiv6AgKSEhVl6D1i1HVqnkynN5LgT4IcChVTmFJN27Pt4ezdKhUVffuKP8I0LWbfc/tN86dyaG+uw10coVt6WpFQNsmden1sjgBUiTBSGppzl0NE+526qr5u1ofRoa1LdtQoHbPHTFtTKZKjVQ2LOUksb92i/ZJ4wCVxfyQHN5zSOsFrOn8LgmPHCuBjtayFLFHZ8Q==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777183811; cv=none;\n b=dT+UFTIpFLaZJOcOLjFpRXenxkZIr1ThupGl7huEbvzV7ReSmd3WXH1HM2siyIxQhwF3BSPcHG6O5DGZyMgG8foQcecUOmpC4rLXWuCsmnulW2QwlGtfk97i3c+37w+zvdgXPFB4pyH5XnJ+9up15/euDTjIVB2xNRjvhoi6bfM="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777183822; c=relaxed/relaxed;\n\tbh=VkekR0ZQnUPB8h/ezh7yPJ5uGQoJ/UJN/CJfNPlzUlA=;\n\th=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:\n\t Content-Disposition;\n b=VqHTyjQPV/XdkRXx3F356EmQCd6ijUk30yx7qS+BYnjsk24W3ltjEz2gAIdMrMa/C1+YaGieIZitozJoxyhVSJclgvcREjmXGjf4lXIRUQxGKCratYISFjHewe8uFlNn/bOL0/kJ5VJCRASSg0SKRAdtyCe/H9jj9/GnK/C068WcGwaiDg0+P5h9aTP/bGYRqikDOgw6P1KsVvvG/Vr4oquhzApe8iqvvEMMqUXGRPJu2JAEHhJ9F3ZyH9Na26dWGMFTYWNP/GoIZk51QYvHxxj/7svoemdSSthchOWBJlKPeMAE/zQY0tMRQPxaMIeo8FjKl/qxekYBfzKxf9MFcA==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777183811; c=relaxed/simple;\n\tbh=3N3qSO6MSIoGnvIb9NPtscc7rRE2OiowJp5tLfBb7YQ=;\n\th=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:\n\t Content-Disposition;\n b=I3HcaPRwecyaaIzeKastr+vJfb3O8TEVCv61hUiDvaQwehgCSO0wVgmnnvYGYa35gPSayNTs6SHYJntlnIc23f+DrY4jJaRqA52ZKsfgIiY9PjsqWprX4pLCtVFLgt8HPgKV+DbA4un6dPy56J8DhlJC0wibmayBZU5dzPbTu0k="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk;\n dkim=pass (2048-bit key;\n unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.a=rsa-sha256\n header.s=zeniv-20220401 header.b=OlCHV83d; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16101-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk;\n spf=none smtp.mailfrom=ftp.linux.org.uk;\n dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk\n header.b=OlCHV83d; arc=none smtp.client-ip=62.89.141.173"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Type:MIME-Version:\n\tMessage-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:\n\tContent-ID:Content-Description:In-Reply-To:References;\n\tbh=VkekR0ZQnUPB8h/ezh7yPJ5uGQoJ/UJN/CJfNPlzUlA=; b=OlCHV83dFVTNE7YCwNCWT10V6S\n\tTLgmd35QRm5CKtkkdiTNBYuhOrC2SGR1GnzRMNWW1yGIZmgdHuOg9JxnejZ8PsY9GR7yTAfS2c579\n\tnaKT4eS6R90RdrHXmhgYGauZIXVdjLUcubvnGyCEAjSm/+/wfL7ZvTaFUWlwuKOtwZqZXyqACIAlm\n\tPxi85any2T6FsOujDvx85cwSFHjUuOeGuGMcm9WrOHxTfm62PRx/bDtjZ3RUSlvCGeO54ePrxZ5wb\n\tFhJYfav4AmH5VMNKE74N7aFJhIaQHmvPytPyBRpp2ENTPGbnygi0w42/LF2sbBC/ONUjdnNks146b\n\tBq4vCbWw==;","Date":"Sun, 26 Apr 2026 07:10:09 +0100","From":"Al Viro <viro@zeniv.linux.org.uk>","To":"Theodore Ts'o <tytso@mit.edu>","Cc":"linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org","Subject":"why does ext4_sync_parent() bother with d_find_any_alias() at all?","Message-ID":"<20260426061009.GQ3518998@ZenIV>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","Sender":"Al Viro <viro@ftp.linux.org.uk>","X-Spam-Status":"No, score=-1.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DMARC_PASS,HEADER_FROM_DIFFERENT_DOMAINS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"The caller has a dentry for that inode, after all...\nAm I missing something there?  IOW, is there anything wrong\nwith something like (untested) patch below?","diff":"diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c\nindex 924726dcc85f..c635cd732c2e 100644\n--- a/fs/ext4/fsync.c\n+++ b/fs/ext4/fsync.c\n@@ -43,16 +43,14 @@\n  * the parent directory's parent as well, and so on recursively, if\n  * they are also freshly created.\n  */\n-static int ext4_sync_parent(struct inode *inode)\n+static int ext4_sync_parent(struct inode *inode, struct dentry *dentry)\n {\n-\tstruct dentry *dentry, *next;\n+\tstruct dentry *next;\n \tint ret = 0;\n \n \tif (!ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY))\n \t\treturn 0;\n-\tdentry = d_find_any_alias(inode);\n-\tif (!dentry)\n-\t\treturn 0;\n+\tdget(dentry);\n \twhile (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {\n \t\text4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);\n \n@@ -99,7 +97,7 @@ static int ext4_fsync_nojournal(struct file *file, loff_t start, loff_t end,\n \tif (ret)\n \t\treturn ret;\n \n-\tret = ext4_sync_parent(inode);\n+\tret = ext4_sync_parent(inode, file->f_path.dentry);\n \n \tif (test_opt(inode->i_sb, BARRIER))\n \t\t*needs_barrier = true;\n","prefixes":[]}