Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229605/?format=api
{ "id": 2229605, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229605/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260428131756.922303-24-dhowells@redhat.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260428131756.922303-24-dhowells@redhat.com>", "date": "2026-04-28T13:17:53", "name": "[v5,23/24] netfs, afs: Fix write skipping in dir/link writepages", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "55b9407eb1b4841881a1c3ca119101c84bef9543", "submitter": { "id": 59, "url": "http://patchwork.ozlabs.org/api/1.1/people/59/?format=api", "name": "David Howells", "email": "dhowells@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260428131756.922303-24-dhowells@redhat.com/mbox/", "series": [ { "id": 501852, "url": "http://patchwork.ozlabs.org/api/1.1/series/501852/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=501852", "date": "2026-04-28T13:17:35", "name": "netfs: Miscellaneous fixes", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/501852/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229605/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229605/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-cifs+bounces-11211-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=YWOORkMX;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11211-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=\"YWOORkMX\"", "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4g4j1Z1TwSz1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 00:07:30 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 1DA0732860BF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 13:30:42 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 47669480DF5;\n\tTue, 28 Apr 2026 13:20:00 +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 CAC5C47887B\n\tfor <linux-cifs@vger.kernel.org>; Tue, 28 Apr 2026 13:19:58 +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-474-3o6WZebRMVq1RarP7C2BZg-1; Tue,\n 28 Apr 2026 09:19:54 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\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 03053195605B;\n\tTue, 28 Apr 2026 13:19:53 +0000 (UTC)", "from warthog.procyon.org.com (unknown [10.44.32.126])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 1473F180047F;\n\tTue, 28 Apr 2026 13:19:49 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777382400; cv=none;\n b=ab19HT3UcRuxawqttBH0PNjDPyC8rsg9LoZg6tlkDlA1ZOMB0um6vl+dbd68Qrvp1i2XbUirtgeCBIDmkaUmaCPbnucDsOO1s+dLH6VdypZjAKOCsoxELl8bLwIERpk2N4YDCzIiN3R6w38EZkIdKrat81QKbLo9nDpZ+0V6xfE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777382400; c=relaxed/simple;\n\tbh=hhlZHzVkZGgNw65TAqSXoZn8aY9+h0Opjd6qveHBrl8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=XjBGg/tsLAgoBGrDqc8xm0IuS69edwNo9xpYtethys2RpOEagBVFqYESROXrwKerBgmh+0IIu+UOG+N5z3ENNvouxoMF1KuKIiQBRaSfWeqJQf6KVeziGW5RQYfGRGHuG5befoucmI4O4JyFlAScXmRpt9m00W97CjMQnFpFB2E=", "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=YWOORkMX; 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=1777382398;\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=mt629XDWKB+tZOOSAJE2LdFWKC9Q9poIqsffgDORXAw=;\n\tb=YWOORkMXqsilqZnHqdGg2q+ILzr+Iwgj1MB2TAPofeFtz95ifEviUNENy0vqMERRGME3ec\n\tdK2K7HwvDsoSGRuX3k4V2bMjcKYmL2AL1jWMe2S5TgIImry0TGmks+XxCEYTAwcmf5+xpk\n\tvdDGr5swZJqMiMQaAl2mOUXyC2RH7Qs=", "X-MC-Unique": "3o6WZebRMVq1RarP7C2BZg-1", "X-Mimecast-MFC-AGG-ID": "3o6WZebRMVq1RarP7C2BZg_1777382393", "From": "David Howells <dhowells@redhat.com>", "To": "Christian Brauner <christian@brauner.io>", "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tMarc Dionne <marc.dionne@auristor.com>", "Subject": "[PATCH v5 23/24] netfs,\n afs: Fix write skipping in dir/link writepages", "Date": "Tue, 28 Apr 2026 14:17:53 +0100", "Message-ID": "<20260428131756.922303-24-dhowells@redhat.com>", "In-Reply-To": "<20260428131756.922303-1-dhowells@redhat.com>", "References": "<20260428131756.922303-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.4.1 on 10.30.177.93" }, "content": "Fix netfs_write_single() and afs_single_writepages() to better handle a\nwrite that would be skipped due to lock contention and WB_SYNC_NONE by\nreturning 1 from netfs_write_single() if it skipped and making\nafs_single_writepages() skip also. If a skip occurs, the inode must be\nre-marked as the VFS may have cleared the mark.\n\nThis is really only theoretical for directories in netfs_write_single() as\nthe only path to that is through afs_single_writepages() that takes the\n->validate_lock around it, thereby serialising it.\n\nFixes: 6dd80936618c (\"afs: Use netfslib for directories\")\nSigned-off-by: David Howells <dhowells@redhat.com>\ncc: Marc Dionne <marc.dionne@auristor.com>\ncc: linux-afs@lists.infradead.org\ncc: linux-fsdevel@vger.kernel.org\n---\n fs/afs/dir.c | 11 ++++++++++-\n fs/netfs/write_issue.c | 7 ++++++-\n 2 files changed, 16 insertions(+), 2 deletions(-)", "diff": "diff --git a/fs/afs/dir.c b/fs/afs/dir.c\nindex aaaa55878ffd..d1542a1a50bf 100644\n--- a/fs/afs/dir.c\n+++ b/fs/afs/dir.c\n@@ -2206,7 +2206,14 @@ int afs_single_writepages(struct address_space *mapping,\n \t/* Need to lock to prevent the folio queue and folios from being thrown\n \t * away.\n \t */\n-\tdown_read(&dvnode->validate_lock);\n+\tif (!down_read_trylock(&dvnode->validate_lock)) {\n+\t\tif (wbc->sync_mode == WB_SYNC_NONE) {\n+\t\t\t/* The VFS will have undirtied the inode. */\n+\t\t\tnetfs_single_mark_inode_dirty(&dvnode->netfs.inode);\n+\t\t\treturn 0;\n+\t\t}\n+\t\tdown_read(&dvnode->validate_lock);\n+\t}\n \n \tif (is_dir ?\n \t test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) :\n@@ -2214,6 +2221,8 @@ int afs_single_writepages(struct address_space *mapping,\n \t\tiov_iter_folio_queue(&iter, ITER_SOURCE, dvnode->directory, 0, 0,\n \t\t\t\t i_size_read(&dvnode->netfs.inode));\n \t\tret = netfs_writeback_single(mapping, wbc, &iter);\n+\t\tif (ret == 1)\n+\t\t\tret = 0; /* Skipped write due to lock conflict. */\n \t}\n \n \tup_read(&dvnode->validate_lock);\ndiff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c\nindex 0b07ebecb157..a85ec300b79a 100644\n--- a/fs/netfs/write_issue.c\n+++ b/fs/netfs/write_issue.c\n@@ -823,6 +823,9 @@ static int netfs_write_folio_single(struct netfs_io_request *wreq,\n *\n * Write a monolithic, non-pagecache object back to the server and/or\n * the cache.\n+ *\n+ * Return: 0 if successful; 1 if skipped due to lock conflict and WB_SYNC_NONE;\n+ * or a negative error code.\n */\n int netfs_writeback_single(struct address_space *mapping,\n \t\t\t struct writeback_control *wbc,\n@@ -839,8 +842,10 @@ int netfs_writeback_single(struct address_space *mapping,\n \n \tif (!mutex_trylock(&ictx->wb_lock)) {\n \t\tif (wbc->sync_mode == WB_SYNC_NONE) {\n+\t\t\t/* The VFS will have undirtied the inode. */\n+\t\t\tnetfs_single_mark_inode_dirty(&ictx->inode);\n \t\t\tnetfs_stat(&netfs_n_wb_lock_skip);\n-\t\t\treturn 0;\n+\t\t\treturn 1;\n \t\t}\n \t\tnetfs_stat(&netfs_n_wb_lock_wait);\n \t\tmutex_lock(&ictx->wb_lock);\n", "prefixes": [ "v5", "23/24" ] }