Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1890359/?format=api
{ "id": 1890359, "url": "http://patchwork.ozlabs.org/api/patches/1890359/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-2-willy@infradead.org/", "project": { "id": 3, "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api", "name": "Linux MTD development", "link_name": "linux-mtd", "list_id": "linux-mtd.lists.infradead.org", "list_email": "linux-mtd@lists.infradead.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20240124175302.1750912-2-willy@infradead.org>", "list_archive_url": null, "date": "2024-01-24T17:52:44", "name": "[v2,01/15] ubifs: Set page uptodate in the correct place", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "826571b8eb4c1d41e43057129ddaf82709e53fd7", "submitter": { "id": 70855, "url": "http://patchwork.ozlabs.org/api/people/70855/?format=api", "name": "Matthew Wilcox", "email": "willy@infradead.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-2-willy@infradead.org/mbox/", "series": [ { "id": 391975, "url": "http://patchwork.ozlabs.org/api/series/391975/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=391975", "date": "2024-01-24T17:52:56", "name": "ubifs folio conversion", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/391975/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1890359/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1890359/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ydjaziZF;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=casper.20170209 header.b=GpzadNX7;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4TKs5P1DN9z23f0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2024 04:53:45 +1100 (AEDT)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux))\n\tid 1rShR5-004ZrZ-07;\n\tWed, 24 Jan 2024 17:53:15 +0000", "from casper.infradead.org ([2001:8b0:10b:1236::1])\n\tby bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux))\n\tid 1rShQz-004ZnM-2u\n\tfor linux-mtd@bombadil.infradead.org;\n\tWed, 24 Jan 2024 17:53:10 +0000", "from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red\n Hat Linux))\n\tid 1rShQu-00000007LVL-3I7V;\n\tWed, 24 Jan 2024 17:53:04 +0000" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Lgs2eKd+rHCN3OgQzp0pnVDzL5io+EYkCdRC+LofMrU=; b=ydjaziZFjdfZpY\n\tC8bIYsPs/BPZ4hpX2A0kez8VMfSieehA18JCdrn6Aup11rEIm9d3D8kT/gccPGbzhs/tyheP8MH66\n\t8wCx1CcDA2vtRMWKAS59zh2CXWHKUv97mg9Q/124Fap7o4rIGJ8JcRa03F/SYr4pvZ0onLRu5iWwD\n\tWDmJvniNj/Ks0OkNvhjK3os2B/5ZeVn/VWlbeD+at3ZBPB3W+tPKfvBbFgTeNsmEo3KlP59ppNdd8\n\tXl3D5Y0xSriczMXpu9r6MZUT4CdIZxmUif84RgGGRKK/jKluBo1yYFVHez3FzA5dcQwhSs6RrazKv\n\tV0CuElTk79G5monND2Dg==;", "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=4BLcXtunv8K55EIbLY6Cz+Ba9KEcTs01x6W2txMgvd4=; b=GpzadNX7vKAg0W1zJQWMGP7nCA\n\thAnJIOYgyBkTKcMI2XJly6GLL1gfJal3ppuBSXC2I7G3rXSvMwhZdSysVwJkg8b7XeGLtvJIhO51R\n\tbBD4ZFNAwtKm6d4N5PdxWgFxE2et9YXSw0a8leQbv8KBQ/KmTnFRZvfrhkKmkX5zsnONCs5sGsskR\n\t9lEb1/MZRDfTZ77H0QdkNIlaOJ7dHF4rPrMWfyg1anktS/AxY7xYAkgNQi0szLNBCvNB14vJicKou\n\tvvS0PPM/+9thoNkE+N5R+w0tfm6TPL0lmi2dMod1Fbp9fFszvXVjcAtpWKF0bPDBffMu2eZOu8j2q\n\tyTYeDm0g==;" ], "From": "\"Matthew Wilcox (Oracle)\" <willy@infradead.org>", "To": "Richard Weinberger <richard@nod.at>", "Cc": "\"Matthew Wilcox (Oracle)\" <willy@infradead.org>,\n\tlinux-mtd@lists.infradead.org,\n\tstable@vger.kernel.org", "Subject": "[PATCH v2 01/15] ubifs: Set page uptodate in the correct place", "Date": "Wed, 24 Jan 2024 17:52:44 +0000", "Message-ID": "<20240124175302.1750912-2-willy@infradead.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240124175302.1750912-1-willy@infradead.org>", "References": "<20240124175302.1750912-1-willy@infradead.org>", "MIME-Version": "1.0", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>", "List-Post": "<mailto:linux-mtd@lists.infradead.org>", "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>", "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "Page cache reads are lockless, so setting the freshly allocated page\nuptodate before we've overwritten it with the data it's supposed to have\nin it will allow a simultaneous reader to see old data. Move the call\nto SetPageUptodate into ubifs_write_end(), which is after we copied the\nnew data into the page.\n\nFixes: 1e51764a3c2a (\"UBIFS: add new flash file system\")\nCc: stable@vger.kernel.org\nSigned-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>\n---\n fs/ubifs/file.c | 13 ++++---------\n 1 file changed, 4 insertions(+), 9 deletions(-)", "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex 5029eb3390a5..d0694b83dd02 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -261,9 +261,6 @@ static int write_begin_slow(struct address_space *mapping,\n \t\t\t\treturn err;\n \t\t\t}\n \t\t}\n-\n-\t\tSetPageUptodate(page);\n-\t\tClearPageError(page);\n \t}\n \n \tif (PagePrivate(page))\n@@ -463,9 +460,6 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,\n \t\t\t\treturn err;\n \t\t\t}\n \t\t}\n-\n-\t\tSetPageUptodate(page);\n-\t\tClearPageError(page);\n \t}\n \n \terr = allocate_budget(c, page, ui, appending);\n@@ -475,10 +469,8 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,\n \t\t * If we skipped reading the page because we were going to\n \t\t * write all of it, then it is not up to date.\n \t\t */\n-\t\tif (skipped_read) {\n+\t\tif (skipped_read)\n \t\t\tClearPageChecked(page);\n-\t\t\tClearPageUptodate(page);\n-\t\t}\n \t\t/*\n \t\t * Budgeting failed which means it would have to force\n \t\t * write-back but didn't, because we set the @fast flag in the\n@@ -569,6 +561,9 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,\n \t\tgoto out;\n \t}\n \n+\tif (len == PAGE_SIZE)\n+\t\tSetPageUptodate(page);\n+\n \tif (!PagePrivate(page)) {\n \t\tattach_page_private(page, (void *)1);\n \t\tatomic_long_inc(&c->dirty_pg_cnt);\n", "prefixes": [ "v2", "01/15" ] }