Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229254/?format=api
{ "id": 2229254, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229254/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260427222300.1284855-1-coshi036@gmail.com/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/1.1/projects/8/?format=api", "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": "<20260427222300.1284855-1-coshi036@gmail.com>", "date": "2026-04-27T22:23:00", "name": "ext4: avoid __GFP_NOFAIL in __ext4_get_inode_loc allocation", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1fd8bd4aecf044977d800e0592051f954d772ad1", "submitter": { "id": 93265, "url": "http://patchwork.ozlabs.org/api/1.1/people/93265/?format=api", "name": "Chao Shi", "email": "coshi036@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260427222300.1284855-1-coshi036@gmail.com/mbox/", "series": [ { "id": 501735, "url": "http://patchwork.ozlabs.org/api/1.1/series/501735/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=501735", "date": "2026-04-27T22:23:00", "name": "ext4: avoid __GFP_NOFAIL in __ext4_get_inode_loc allocation", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501735/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229254/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229254/checks/", "tags": {}, "headers": { "Return-Path": "\n <SRS0=6d1n=C2=vger.kernel.org=linux-ext4+bounces-16131-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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=cvwglyPc;\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=6d1n=c2=vger.kernel.org=linux-ext4+bounces-16131-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org", "gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=cvwglyPc;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16131-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"cvwglyPc\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.221.172", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "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 4g4J6S3m79z1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:25:19 +1000 (AEST)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g4J6R2j4Fz4wJP\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:25:19 +1000 (AEST)", "by gandalf.ozlabs.org (Postfix)\n\tid 4g4J6R2c9Fz4wJs; Tue, 28 Apr 2026 08:25:19 +1000 (AEST)", "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4g4J6M2zk3z4wJP\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 28 Apr 2026 08:25:15 +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 8A4C7300D6B0\n\tfor <patchwork-incoming@ozlabs.org>; Mon, 27 Apr 2026 22:23:09 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C2515350D7F;\n\tMon, 27 Apr 2026 22:23:08 +0000 (UTC)", "from mail-vk1-f172.google.com (mail-vk1-f172.google.com\n [209.85.221.172])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 3966C346AFD\n\tfor <linux-ext4@vger.kernel.org>; Mon, 27 Apr 2026 22:23:07 +0000 (UTC)", "by mail-vk1-f172.google.com with SMTP id\n 71dfb90a1353d-56f75445470so6167859e0c.2\n for <linux-ext4@vger.kernel.org>;\n Mon, 27 Apr 2026 15:23:07 -0700 (PDT)", "from syssplab.cs.fiu.edu (nat1.cs.fiu.edu. [131.94.134.89])\n by smtp.gmail.com with ESMTPSA id\n 71dfb90a1353d-573a4338401sm625614e0c.4.2026.04.27.15.23.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 15:23:04 -0700 (PDT)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777328719; cv=pass;\n\tb=bsB7CxNZPJ3WCND9YuNLEVGbshcY93xHM0Zd/w2CCwoQULBnMdNtleT2psI1hJBUCSas7miz1YhiXfw+/OyKbATUpyX22biv5HfDt3y6Isz80vx1Tp1eI8lDGozoZ/q7EKYkAQPGCr9GiyMsl5QyaP+4H4vYEn8w1+DZfmRhFvNjONBt1JiO0V+ejs7ZS3zdZTT5a7mFFW13ekW3HcN5inf7v+PcWgLXYhCXJCJTYfInFQZz7dPEPXUjDWvDdB82wWovktSOuHzxmRB3bB3kI151bplCju+JzsONEWGsdrDP3lg+S2Dgfj7mA00n0u+q0Ijc6vZYrw6rznyqyNRN9A==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777328588; cv=none;\n b=nl838il/Jk/OajLi4jk9Vbk9C/V6uMyKUblyoL5hCZVSDQEg38AMLS9KFYVqzcaI2AyW8eh7vW7aElXt/oeqr8fWwexc+FSUMhjKvcmvyHdvYkRHSsOCZfwvAHbMoC+0lC3VD7MccjUEdXYMxyq9X7ahv7iuuVW0Shj6Yg4R/mc=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777328719; c=relaxed/relaxed;\n\tbh=CW0tLQdd/fFSU3R2B/ztWAeJIMQ2wqigKRMmO6vFKbM=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=nB2CONwNGjNF2eHR1mzFzFSxBy9D3E+rHjJ+/D74p51LAMQEFJurFAetucsAxOhiesCt+Tq0DxBceT9XCKwS48vk18T05dXgeaC8u73l7qBYp6Al1Jwd1fiamvxpRn+yvJ2rZYs0az2xURXty1PyowVvjowtHe3EsLLIfdnoZe5ybVAa7Mwc51C1yEkFsUHRsmRdHsae1QUDcioAnrcLKSTRt9P3bObWLrYnbYW5RoQ6nGT56i4Ovon3nbq92tfXSqcSjXt293lTnp7p0zf5y36WFW7K8INRsMk366KDdK3bTTPxou2a79PVtYMNiC6WZOtlN9KJHLMtu2LzZMOadA==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777328588; c=relaxed/simple;\n\tbh=cnLQ03yJKbFzs/YMJJsj9Uhc8Frpa3LYSsaNU8nZN4c=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=RsSc8efT5wC9NWhrin1SZRFpEuwFuVa4VlrtaLfgadfTaLvCyYaAtSWiihKSJEN60rP8hcU1k6oT/VTsEe4/spnZShHGvO0sGVUb7HSAz+RmwaPmLjMt6wFD1l+BsqlL19v72YEogRJyfPYXlgxLuyaSiUIQxV4cRBSrL1gNa4o=" ], "ARC-Authentication-Results": [ "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=cvwglyPc; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16131-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=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=cvwglyPc; arc=none smtp.client-ip=209.85.221.172" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777328586; x=1777933386;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=CW0tLQdd/fFSU3R2B/ztWAeJIMQ2wqigKRMmO6vFKbM=;\n b=cvwglyPcNijgNG9yecCxeiQrkuCohWZjxU994CGDogzG9t+2IppN/wNcCTb3nCZ4mt\n JanGCHMSifJm9YmKO3MuZfdLKmiCEcw7U0I4vkl0zzRpHgjjnTgxCtAN6U4rskkgAcN/\n xDToWJeb3Q7RM9PRmMppdX+w7DL4ASLv6G65JbA1AOASijb1eu2jTXafB1p1JVT1dPcw\n nQMpT17cTO0m32QFbDLFVk011c2IIOIDNCs28YZ32xSMPO6lYxJxurBmSQSThlP1qern\n KeStv4dJ91YagpjPaPgqxePMl8vSL7GPuv0UKzv0fsPF6dP9HIYvELBuxvY00pg/tKVU\n gHgw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777328586; x=1777933386;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=CW0tLQdd/fFSU3R2B/ztWAeJIMQ2wqigKRMmO6vFKbM=;\n b=at3shsltxTomXpPMwKVE+BDx7d8Tk59Ype2+LeHLZNaqhHcLkb7ownwW46lJoPP637\n tUCaESjqt0R/JGHjL0nJstqRNmy2M9EKefu9Vn8bn2SQflsvXJtTPsSDrxPWzH9J9a8/\n dYiAfH57+LMysN6OhUBkc/FEbBrEhVrfpyD+8TORiAUIObsG45q07qKofK7EUJwHF8AI\n ekMEumjbZ1vDRfD9vK5442AHR81BRuvlK6Uns1RP7h5bTLJTcvRV2SIWSFeFyc+dRLzO\n PHcaNEI2DYEJHURhqaStPiHrXrdiBeFqTlb2O6bK+gte+tWWP8/QgByYV6sJioBLUWOH\n UB8w==", "X-Gm-Message-State": "AOJu0YwG/pdeHyMhv1Ps4kClsI9NFqOyin0sQB71RlmprqLfvObU5swT\n\ta2m2LqxfJNQ2fmP39DoF19uefPLlqIeDDFnwJOLF5Q9q7DEAlhLkalWJN9aNuFrKjl0=", "X-Gm-Gg": "AeBDievCjLQNy/h6VrsDrSCFRdWovcmjvHXw/BxuTKUFNCns9+mXEhY04FEGzkZfKYh\n\tIRXZsJgFxAQNYnQAQz4ogMuJ47mf2Do8uW2fxz5BNc6p1lYcv1g4oLC2NEvRoGlfvbkQ2rZ+uwd\n\tJPnvZEJaENG3Oen6ikq7gQbYevBbxVh6Hj3M62g7Lei/jEeJyqK1BocafuaN+hPLL0GV4OxR2nh\n\t2iPjjnmXkmhddIfrw+UG8Q0J+z+mZk7bRTrU+4wE7u8V9zDpEAmxtddUG4Lx6aOiDdA6/5gSiVt\n\tnyxa3t9kse7yvlobFNsT8dsKXKsV9nkIz+2fs1AvQVthoANUOw3bSQG862JSVx6pwNj02qoJ81F\n\tbX+TAEMOD+Q+TBrAduSasA5/LNdIpLbB4XIwdnaJelzJQ4NLJrqGZBNkH82SIi6xzOgBzbjddZF\n\tIBZhSnZh0dpaYabjNMKA+jaXhB5E6EV/FB/anedzxYbQTM8s+Ge66F", "X-Received": "by 2002:a05:6122:3223:b0:56b:7023:1393 with SMTP id\n 71dfb90a1353d-573a563761dmr325205e0c.11.1777328584746;\n Mon, 27 Apr 2026 15:23:04 -0700 (PDT)", "From": "Chao Shi <coshi036@gmail.com>", "To": "linux-ext4@vger.kernel.org", "Cc": "tytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tjack@suse.cz,\n\tChao Shi <coshi036@gmail.com>,\n\tSungwoo Kim <iam@sung-woo.kim>,\n\tDave Tian <daveti@purdue.edu>,\n\tWeidong Zhu <weizhu@fiu.edu>", "Subject": "[PATCH] ext4: avoid __GFP_NOFAIL in __ext4_get_inode_loc allocation", "Date": "Mon, 27 Apr 2026 18:23:00 -0400", "Message-ID": "<20260427222300.1284855-1-coshi036@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "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-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tFREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,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": "When kswapd shrinks the dcache, the last iput() on an ext4 inode can\ntrigger ext4_orphan_del(), which calls ext4_reserve_inode_write() and\nultimately __ext4_get_inode_loc(). That function calls sb_getblk(),\nwhich wraps __getblk() and carries implicit __GFP_NOFAIL. Because\nkswapd runs with PF_MEMALLOC set, combining NOFAIL with a non-reclaimable\ncontext trips WARN_ON_ONCE(current->flags & PF_MEMALLOC) inside\n__alloc_pages_slowpath(), producing a spurious splat even though the\nallocation could simply fail and return -ENOMEM to the caller.\n\nSwitch both sb_getblk() call sites in __ext4_get_inode_loc() to\nsb_getblk_gfp() with the same flags minus __GFP_NOFAIL\n(mapping_gfp_constraint(~__GFP_FS) | __GFP_MOVABLE), computing the gfp\nvalue once and reusing it for the optional bitmap_bh optimisation fetch.\nAll callers of __ext4_get_inode_loc() -- reached via ext4_get_inode_loc(),\n__ext4_get_inode_loc_noinmem(), and ext4_get_fc_inode_loc() -- already\npropagate a non-zero return as an error without aborting the filesystem.\nBoth sb_getblk() call sites in __ext4_get_inode_loc() are converted; the\nbitmap_bh fetch already falls back to make_io on NULL, so allowing it to\nfail is a no-op there.\n\nReproduced under syzkaller+FEMU based fuzz tool (FuzzNvme) on x86_64 QEMU,\nbased on mainline 894009e2ef10:\n\n WARNING: CPU: 0 PID: 55 at mm/page_alloc.c:4722\n __alloc_pages_slowpath\n Comm: kswapd0 Not tainted 6.19.0+ #14\n Call Trace:\n __alloc_pages_slowpath\n alloc_pages_mpol\n folio_alloc_noprof\n filemap_alloc_folio_noprof\n __filemap_get_folio\n grow_dev_folio\n grow_buffers\n __getblk_slow\n bdev_getblk\n __ext4_get_inode_loc\n ext4_get_inode_loc\n ext4_reserve_inode_write\n ext4_orphan_del\n ext4_evict_inode\n evict\n iput\n dentry_unlink_inode\n __dentry_kill\n shrink_dentry_list\n prune_dcache_sb\n super_cache_scan\n do_shrink_slab\n shrink_slab\n shrink_node\n balance_pgdat\n kswapd\n kthread\n ret_from_fork\n\nRelated: see d8b90e6387a (\"ext4: add ext4_sb_bread_nofail() helper\nfunction for ext4_free_branches()\") for the same strategy applied to\nthe read path in ext4_free_branches().\nLink: https://lore.kernel.org/all/?q=PF_MEMALLOC+nofail+ext4+iput\n\nAcked-by: Sungwoo Kim <iam@sung-woo.kim>\nAcked-by: Dave Tian <daveti@purdue.edu>\nAcked-by: Weidong Zhu <weizhu@fiu.edu>\nSigned-off-by: Chao Shi <coshi036@gmail.com>\n---\n fs/ext4/inode.c | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)", "diff": "diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex c2c2d6ac7f3..1b2a7bd59b8 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -4859,6 +4859,7 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,\n \text4_fsblk_t\t\tblock;\n \tstruct blk_plug\t\tplug;\n \tint\t\t\tinodes_per_block, inode_offset;\n+\tgfp_t\t\t\tgfp;\n \n \tiloc->bh = NULL;\n \tif (ino < EXT4_ROOT_INO ||\n@@ -4887,7 +4888,14 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,\n \t}\n \tblock += (inode_offset / inodes_per_block);\n \n-\tbh = sb_getblk(sb, block);\n+\t/*\n+\t * No __GFP_NOFAIL: this can run from reclaim context (kswapd\n+\t * shrinker -> iput -> ext4_orphan_del path) where NOFAIL trips\n+\t * WARN_ON_ONCE in __alloc_pages_slowpath().\n+\t */\n+\tgfp = mapping_gfp_constraint(sb->s_bdev->bd_mapping, ~__GFP_FS) |\n+\t\t__GFP_MOVABLE;\n+\tbh = sb_getblk_gfp(sb, block, gfp);\n \tif (unlikely(!bh))\n \t\treturn -ENOMEM;\n \tif (ext4_buffer_uptodate(bh))\n@@ -4912,7 +4920,7 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,\n \t\tstart = inode_offset & ~(inodes_per_block - 1);\n \n \t\t/* Is the inode bitmap in cache? */\n-\t\tbitmap_bh = sb_getblk(sb, ext4_inode_bitmap(sb, gdp));\n+\t\tbitmap_bh = sb_getblk_gfp(sb, ext4_inode_bitmap(sb, gdp), gfp);\n \t\tif (unlikely(!bitmap_bh))\n \t\t\tgoto make_io;\n \n", "prefixes": [] }