Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/810309/?format=api
{ "id": 810309, "url": "http://patchwork.ozlabs.org/api/patches/810309/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20170905223541.20594-6-ross.zwisler@linux.intel.com/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170905223541.20594-6-ross.zwisler@linux.intel.com>", "list_archive_url": null, "date": "2017-09-05T22:35:37", "name": "[5/9] ext4: ext4_change_inode_journal_flag error handling", "commit_ref": null, "pull_url": null, "state": "new", "archived": true, "hash": "d4fd01276a6dfaaaeaec2de25649d3399bc2b93a", "submitter": { "id": 46514, "url": "http://patchwork.ozlabs.org/api/people/46514/?format=api", "name": "Ross Zwisler", "email": "ross.zwisler@linux.intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20170905223541.20594-6-ross.zwisler@linux.intel.com/mbox/", "series": [ { "id": 1660, "url": "http://patchwork.ozlabs.org/api/series/1660/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=1660", "date": "2017-09-05T22:35:36", "name": "add ext4 per-inode DAX flag", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1660/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810309/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810309/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-ext4-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xn1pb6FGjz9sP3\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 6 Sep 2017 08:38:47 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753751AbdIEWiX (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 5 Sep 2017 18:38:23 -0400", "from mga01.intel.com ([192.55.52.88]:63245 \"EHLO mga01.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753802AbdIEWgT (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tTue, 5 Sep 2017 18:36:19 -0400", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Sep 2017 15:36:17 -0700", "from theros.lm.intel.com ([10.232.112.77])\n\tby fmsmga004.fm.intel.com with ESMTP; 05 Sep 2017 15:36:16 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.41,481,1498546800\"; d=\"scan'208\";a=\"308314878\"", "From": "Ross Zwisler <ross.zwisler@linux.intel.com>", "To": "Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org", "Cc": "Ross Zwisler <ross.zwisler@linux.intel.com>,\n\t\"Darrick J. Wong\" <darrick.wong@oracle.com>,\n\t\"Theodore Ts'o\" <tytso@mit.edu>,\n\tAndreas Dilger <adilger.kernel@dilger.ca>,\n\tChristoph Hellwig <hch@lst.de>, Dan Williams <dan.j.williams@intel.com>,\n\tDave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.cz>,\n\tlinux-ext4@vger.kernel.org, linux-nvdimm@lists.01.org,\n\tlinux-xfs@vger.kernel.org, stable@vger.kernel.org", "Subject": "[PATCH 5/9] ext4: ext4_change_inode_journal_flag error handling", "Date": "Tue, 5 Sep 2017 16:35:37 -0600", "Message-Id": "<20170905223541.20594-6-ross.zwisler@linux.intel.com>", "X-Mailer": "git-send-email 2.9.5", "In-Reply-To": "<20170905223541.20594-1-ross.zwisler@linux.intel.com>", "References": "<20170905223541.20594-1-ross.zwisler@linux.intel.com>", "Sender": "linux-ext4-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-ext4.vger.kernel.org>", "X-Mailing-List": "linux-ext4@vger.kernel.org" }, "content": "Rework the error handling in ext4_change_inode_journal_flag() so that\nmultiple paths can re-use portions of the same cleanup code via gotos\ninstead of each path doing their own cleanup. This will benefit later\npatches that add more paths to this function that must be unwound on error.\n\nSigned-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>\nCC: stable@vger.kernel.org\n---\n fs/ext4/inode.c | 24 +++++++++++++-----------\n 1 file changed, 13 insertions(+), 11 deletions(-)", "diff": "diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex 864fb94..d218991 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -5953,11 +5953,8 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)\n \tif (val) {\n \t\tdown_write(&EXT4_I(inode)->i_mmap_sem);\n \t\terr = filemap_write_and_wait(inode->i_mapping);\n-\t\tif (err < 0) {\n-\t\t\tup_write(&EXT4_I(inode)->i_mmap_sem);\n-\t\t\text4_inode_resume_unlocked_dio(inode);\n-\t\t\treturn err;\n-\t\t}\n+\t\tif (err < 0)\n+\t\t\tgoto out_unlock;\n \t}\n \n \tpercpu_down_write(&sbi->s_journal_flag_rwsem);\n@@ -5975,12 +5972,8 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)\n \t\text4_set_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);\n \telse {\n \t\terr = jbd2_journal_flush(journal);\n-\t\tif (err < 0) {\n-\t\t\tjbd2_journal_unlock_updates(journal);\n-\t\t\tpercpu_up_write(&sbi->s_journal_flag_rwsem);\n-\t\t\text4_inode_resume_unlocked_dio(inode);\n-\t\t\treturn err;\n-\t\t}\n+\t\tif (err < 0)\n+\t\t\tgoto out_journal_unlock;\n \t\text4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);\n \t}\n \text4_set_aops(inode);\n@@ -6009,6 +6002,15 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)\n \text4_std_error(inode->i_sb, err);\n \n \treturn err;\n+\n+out_journal_unlock:\n+\tjbd2_journal_unlock_updates(journal);\n+\tpercpu_up_write(&sbi->s_journal_flag_rwsem);\n+out_unlock:\n+\tif (val)\n+\t\tup_write(&EXT4_I(inode)->i_mmap_sem);\n+\text4_inode_resume_unlocked_dio(inode);\n+\treturn err;\n }\n \n static int ext4_bh_unmapped(handle_t *handle, struct buffer_head *bh)\n", "prefixes": [ "5/9" ] }