{"id":829944,"url":"http://patchwork.ozlabs.org/api/1.2/patches/829944/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20171024152415.22864-16-jack@suse.cz/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/1.2/projects/8/?format=json","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":"<20171024152415.22864-16-jack@suse.cz>","list_archive_url":null,"date":"2017-10-24T15:24:12","name":"[15/17] ext4: Simplify error handling in ext4_dax_huge_fault()","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"d823b24c72732ee048e267790bcbd6caccee3cd4","submitter":{"id":363,"url":"http://patchwork.ozlabs.org/api/1.2/people/363/?format=json","name":"Jan Kara","email":"jack@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20171024152415.22864-16-jack@suse.cz/mbox/","series":[{"id":10008,"url":"http://patchwork.ozlabs.org/api/1.2/series/10008/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=10008","date":"2017-10-24T15:23:57","name":"dax, ext4, xfs: Synchronous page faults","version":5,"mbox":"http://patchwork.ozlabs.org/series/10008/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/829944/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/829944/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 3yLxtl0L6bz9t2c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 25 Oct 2017 02:26:07 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932528AbdJXPZ7 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 24 Oct 2017 11:25:59 -0400","from mx2.suse.de ([195.135.220.15]:36144 \"EHLO mx2.suse.de\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S932400AbdJXPZe (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tTue, 24 Oct 2017 11:25:34 -0400","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx2.suse.de (Postfix) with ESMTP id 53009AD7F;\n\tTue, 24 Oct 2017 15:25:28 +0000 (UTC)","by quack2.suse.cz (Postfix, from userid 1000)\n\tid 7279A1E35DC; Tue, 24 Oct 2017 17:25:27 +0200 (CEST)"],"X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","From":"Jan Kara <jack@suse.cz>","To":"Dan Williams <dan.j.williams@intel.com>","Cc":"Ross Zwisler <ross.zwisler@linux.intel.com>,\n\tChristoph Hellwig <hch@infradead.org>,\n\t<linux-ext4@vger.kernel.org>, linux-nvdimm@lists.01.org,\n\t<linux-fsdevel@vger.kernel.org>, <linux-xfs@vger.kernel.org>,\n\tlinux-api@vger.kernel.org, <linux-mm@kvack.org>, Jan Kara <jack@suse.cz>","Subject":"[PATCH 15/17] ext4: Simplify error handling in ext4_dax_huge_fault()","Date":"Tue, 24 Oct 2017 17:24:12 +0200","Message-Id":"<20171024152415.22864-16-jack@suse.cz>","X-Mailer":"git-send-email 2.12.3","In-Reply-To":"<20171024152415.22864-1-jack@suse.cz>","References":"<20171024152415.22864-1-jack@suse.cz>","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":"If transaction starting fails, just bail out of the function immediately\ninstead of checking for that condition throughout the function.\n\nReviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>\nSigned-off-by: Jan Kara <jack@suse.cz>\n---\n fs/ext4/file.c | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)","diff":"diff --git a/fs/ext4/file.c b/fs/ext4/file.c\nindex 3cec0b95672f..208adfc3e673 100644\n--- a/fs/ext4/file.c\n+++ b/fs/ext4/file.c\n@@ -302,16 +302,17 @@ static int ext4_dax_huge_fault(struct vm_fault *vmf,\n \t\tdown_read(&EXT4_I(inode)->i_mmap_sem);\n \t\thandle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE,\n \t\t\t\t\t       EXT4_DATA_TRANS_BLOCKS(sb));\n+\t\tif (IS_ERR(handle)) {\n+\t\t\tup_read(&EXT4_I(inode)->i_mmap_sem);\n+\t\t\tsb_end_pagefault(sb);\n+\t\t\treturn VM_FAULT_SIGBUS;\n+\t\t}\n \t} else {\n \t\tdown_read(&EXT4_I(inode)->i_mmap_sem);\n \t}\n-\tif (!IS_ERR(handle))\n-\t\tresult = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);\n-\telse\n-\t\tresult = VM_FAULT_SIGBUS;\n+\tresult = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);\n \tif (write) {\n-\t\tif (!IS_ERR(handle))\n-\t\t\text4_journal_stop(handle);\n+\t\text4_journal_stop(handle);\n \t\tup_read(&EXT4_I(inode)->i_mmap_sem);\n \t\tsb_end_pagefault(sb);\n \t} else {\n","prefixes":["15/17"]}