Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbcJLWyp (ORCPT ); Wed, 12 Oct 2016 18:54:45 -0400 Received: from mga07.intel.com ([134.134.136.100]:51988 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932872AbcJLWua (ORCPT ); Wed, 12 Oct 2016 18:50:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,485,1473145200"; d="scan'208";a="1064028021" From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@ml01.01.org, linux-xfs@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v6 01/17] ext4: allow DAX writeback for hole punch Date: Wed, 12 Oct 2016 16:50:06 -0600 Message-Id: <20161012225022.15507-2-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161012225022.15507-1-ross.zwisler@linux.intel.com> References: <20161012225022.15507-1-ross.zwisler@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1321 Lines: 36 Currently when doing a DAX hole punch with ext4 we fail to do a writeback. This is because the logic around filemap_write_and_wait_range() in ext4_punch_hole() only looks for dirty page cache pages in the radix tree, not for dirty DAX exceptional entries. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara Cc: --- fs/ext4/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3131747..0900cb4 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3890,7 +3890,7 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset, } /* - * ext4_punch_hole: punches a hole in a file by releaseing the blocks + * ext4_punch_hole: punches a hole in a file by releasing the blocks * associated with the given offset and length * * @inode: File inode @@ -3919,7 +3919,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) * Write out all dirty pages to avoid race conditions * Then release them. */ - if (mapping->nrpages && mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { + if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { ret = filemap_write_and_wait_range(mapping, offset, offset + length - 1); if (ret) -- 2.9.0