Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216361/?format=api
{ "id": 2216361, "url": "http://patchwork.ozlabs.org/api/patches/2216361/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-8-dhowells@redhat.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260326104544.509518-8-dhowells@redhat.com>", "list_archive_url": null, "date": "2026-03-26T10:45:22", "name": "[07/26] cachefiles: Fix excess dput() after end_removing()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a35a201383baf7c16937c64b1bab284ee34e1624", "submitter": { "id": 59, "url": "http://patchwork.ozlabs.org/api/people/59/?format=api", "name": "David Howells", "email": "dhowells@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-8-dhowells@redhat.com/mbox/", "series": [ { "id": 497565, "url": "http://patchwork.ozlabs.org/api/series/497565/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=497565", "date": "2026-03-26T10:45:15", "name": "netfs: Keep track of folios in a segmented bio_vec[] chain", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497565/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216361/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216361/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10530-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-cifs@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=PHcsoPv4;\n\tdkim-atps=neutral", "legolas.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-cifs+bounces-10530-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=\"PHcsoPv4\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.133.124", "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=redhat.com" ], "Received": [ "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 legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLc22Nggz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:08:18 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 7667A3143EC7\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:49:14 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 402103E866A;\n\tThu, 26 Mar 2026 10:47:19 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\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 1595A3E5ECC\n\tfor <linux-cifs@vger.kernel.org>; Thu, 26 Mar 2026 10:47:17 +0000 (UTC)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-292P2OpvMDm-lsocWZMW3Q-1; Thu,\n 26 Mar 2026 06:47:12 -0400", "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 5B90819560BB;\n\tThu, 26 Mar 2026 10:47:09 +0000 (UTC)", "from warthog.procyon.org.com (unknown [10.44.33.121])\n\tby mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id E9D3519560B1;\n\tThu, 26 Mar 2026 10:47:01 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774522039; cv=none;\n b=ZZFF6CjNd4FBi2sUiYpeYu8VO6AUHkK9eVEaIWE2VIuMMkdTHhWjEzZipEwCUAkxnSIGOjtAKil93tIlGAxYCCQUehxzUj8uOm7vCGswRVUY75rd6ZMwB0jUEAJB+BNtlRpA1CTOPgvnMTI0RB3PgNbMgKRjpW+BlbcvbWkVfcU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774522039; c=relaxed/simple;\n\tbh=5oiL4h3gwETW05fsIL6ptaxARlHp1gU+1xVFfXCtL9Y=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=FXDI5jWSu5LaOFfNkt+9weVKS13CeO/uNObJrVMSXyhrf700FQ+gvRnS2EutKakW3UZG+v4Utn+5hr0NyblERnlEozQyYAel/nLtvyXezZV1vmECQN6XYcEAxDcZdv6WeMhJFa61SkkzS5Ey4IMJvIFkJHBDzfB7SwRfWAchtAU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com;\n spf=pass smtp.mailfrom=redhat.com;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=PHcsoPv4; arc=none smtp.client-ip=170.10.133.124", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1774522036;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=8pMTqSI3JlWcbbZ5ax9gnuhYVE8KLn3P9vdg2r2cDfs=;\n\tb=PHcsoPv4VOhZwnBth+8Cm8WMMCG68v1xtdYfsmuuYT/lyFZFExRxF+5O6Do8S1hYwaeBSp\n\tP+nkp92rAV4ycrzVWJsWL2LCaxC6ZYBe/tzGSCUaqaVSUjDMpoLZU0BX+vHV05mhSjS87Q\n\tTESDxNh8i+x/3DnvNLHd6vQDpXZbvfU=", "X-MC-Unique": "292P2OpvMDm-lsocWZMW3Q-1", "X-Mimecast-MFC-AGG-ID": "292P2OpvMDm-lsocWZMW3Q_1774522029", "From": "David Howells <dhowells@redhat.com>", "To": "Christian Brauner <christian@brauner.io>,\n\tMatthew Wilcox <willy@infradead.org>,\n\tChristoph Hellwig <hch@infradead.org>", "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.com>,\n\tJens Axboe <axboe@kernel.dk>,\n\tLeon Romanovsky <leon@kernel.org>,\n\tSteve French <sfrench@samba.org>,\n\tChenXiaoSong <chenxiaosong@chenxiaosong.com>,\n\tMarc Dionne <marc.dionne@auristor.com>,\n\tEric Van Hensbergen <ericvh@kernel.org>,\n\tDominique Martinet <asmadeus@codewreck.org>,\n\tIlya Dryomov <idryomov@gmail.com>,\n\tTrond Myklebust <trondmy@kernel.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-nfs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tv9fs@lists.linux.dev,\n\tlinux-erofs@lists.ozlabs.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tNeilBrown <neil@brown.name>,\n\tPaulo Alcantara <pc@manguebit.org>", "Subject": "[PATCH 07/26] cachefiles: Fix excess dput() after end_removing()", "Date": "Thu, 26 Mar 2026 10:45:22 +0000", "Message-ID": "<20260326104544.509518-8-dhowells@redhat.com>", "In-Reply-To": "<20260326104544.509518-1-dhowells@redhat.com>", "References": "<20260326104544.509518-1-dhowells@redhat.com>", "Precedence": "bulk", "X-Mailing-List": "linux-cifs@vger.kernel.org", "List-Id": "<linux-cifs.vger.kernel.org>", "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12" }, "content": "When cachefiles_cull() calls cachefiles_bury_object(), the latter eats the\nformer's ref on the victim dentry that it obtained from\ncachefiles_lookup_for_cull(). However, commit 7bb1eb45e43c left the dput\nof the victim in place, resulting in occasional:\n\n WARNING: fs/dcache.c:829 at dput.part.0+0xf5/0x110, CPU#7: cachefilesd/11831\n cachefiles_cull+0x8c/0xe0 [cachefiles]\n cachefiles_daemon_cull+0xcd/0x120 [cachefiles]\n cachefiles_daemon_write+0x14e/0x1d0 [cachefiles]\n vfs_write+0xc3/0x480\n ...\n\nreports.\n\nActually, it's worse than that: cachefiles_bury_object() eats the ref it was\ngiven - and then may continue to the now-unref'd dentry it if it turns out to\nbe a directory. So simply removing the aberrant dput() is not sufficient.\n\nFix this by making cachefiles_bury_object() retain the ref itself around\nend_removing() if it needs to keep it and then drop the ref before returning.\n\nFixes: bd6ede8a06e8 (\"VFS/nfsd/cachefiles/ovl: introduce start_removing() and end_removing()\")\nReported-by: Marc Dionne <marc.dionne@auristor.com>\nSigned-off-by: David Howells <dhowells@redhat.com>\ncc: NeilBrown <neil@brown.name>\ncc: Paulo Alcantara <pc@manguebit.org>\ncc: netfs@lists.linux.dev\ncc: linux-afs@lists.infradead.org\ncc: linux-fsdevel@vger.kernel.org\n---\n fs/cachefiles/namei.c | 36 +++++++++++++++++++++---------------\n 1 file changed, 21 insertions(+), 15 deletions(-)", "diff": "diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c\nindex e5ec90dccc27..20138309733f 100644\n--- a/fs/cachefiles/namei.c\n+++ b/fs/cachefiles/namei.c\n@@ -287,14 +287,14 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \tif (!d_is_dir(rep)) {\n \t\tret = cachefiles_unlink(cache, object, dir, rep, why);\n \t\tend_removing(rep);\n-\n \t\t_leave(\" = %d\", ret);\n \t\treturn ret;\n \t}\n \n \t/* directories have to be moved to the graveyard */\n \t_debug(\"move stale object to graveyard\");\n-\tend_removing(rep);\n+\tdget(rep);\n+\tend_removing(rep); /* Drops ref on rep */\n \n try_again:\n \t/* first step is to make up a grave dentry in the graveyard */\n@@ -304,8 +304,10 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \n \t/* do the multiway lock magic */\n \ttrap = lock_rename(cache->graveyard, dir);\n-\tif (IS_ERR(trap))\n-\t\treturn PTR_ERR(trap);\n+\tif (IS_ERR(trap)) {\n+\t\tret = PTR_ERR(trap);\n+\t\tgoto out;\n+\t}\n \n \t/* do some checks before getting the grave dentry */\n \tif (rep->d_parent != dir || IS_DEADDIR(d_inode(rep))) {\n@@ -313,25 +315,27 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \t\t * lock */\n \t\tunlock_rename(cache->graveyard, dir);\n \t\t_leave(\" = 0 [culled?]\");\n-\t\treturn 0;\n+\t\tret = 0;\n+\t\tgoto out;\n \t}\n \n+\tret = -EIO;\n \tif (!d_can_lookup(cache->graveyard)) {\n \t\tunlock_rename(cache->graveyard, dir);\n \t\tcachefiles_io_error(cache, \"Graveyard no longer a directory\");\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \tif (trap == rep) {\n \t\tunlock_rename(cache->graveyard, dir);\n \t\tcachefiles_io_error(cache, \"May not make directory loop\");\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \tif (d_mountpoint(rep)) {\n \t\tunlock_rename(cache->graveyard, dir);\n \t\tcachefiles_io_error(cache, \"Mountpoint in cache\");\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \tgrave = lookup_one(&nop_mnt_idmap, &QSTR(nbuffer), cache->graveyard);\n@@ -343,11 +347,12 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \n \t\tif (PTR_ERR(grave) == -ENOMEM) {\n \t\t\t_leave(\" = -ENOMEM\");\n-\t\t\treturn -ENOMEM;\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto out;\n \t\t}\n \n \t\tcachefiles_io_error(cache, \"Lookup error %ld\", PTR_ERR(grave));\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \tif (d_is_positive(grave)) {\n@@ -362,7 +367,7 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \t\tunlock_rename(cache->graveyard, dir);\n \t\tdput(grave);\n \t\tcachefiles_io_error(cache, \"Mountpoint in graveyard\");\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \t/* target should not be an ancestor of source */\n@@ -370,7 +375,7 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \t\tunlock_rename(cache->graveyard, dir);\n \t\tdput(grave);\n \t\tcachefiles_io_error(cache, \"May not make directory loop\");\n-\t\treturn -EIO;\n+\t\tgoto out;\n \t}\n \n \t/* attempt the rename */\n@@ -404,8 +409,10 @@ int cachefiles_bury_object(struct cachefiles_cache *cache,\n \t__cachefiles_unmark_inode_in_use(object, d_inode(rep));\n \tunlock_rename(cache->graveyard, dir);\n \tdput(grave);\n-\t_leave(\" = 0\");\n-\treturn 0;\n+\t_leave(\" = %d\", ret);\n+out:\n+\tdput(rep);\n+\treturn ret;\n }\n \n /*\n@@ -812,7 +819,6 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,\n \n \tret = cachefiles_bury_object(cache, NULL, dir, victim,\n \t\t\t\t FSCACHE_OBJECT_WAS_CULLED);\n-\tdput(victim);\n \tif (ret < 0)\n \t\tgoto error;\n \n", "prefixes": [ "07/26" ] }