From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ross Zwisler Subject: [PATCH v2 0/2] Add updated DAX locking to ext2 Date: Tue, 13 Oct 2015 16:25:35 -0600 Message-Id: <1444775137-23685-1-git-send-email-ross.zwisler@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Alexander Viro , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Dan Williams , Dave Chinner , "Kirill A. Shutemov" , linux-nvdimm@lists.01.org, Matthew Wilcox List-ID: The first patch in this series is a somewhat related bug fix. The second patch adds new locking to ext2 to isolate DAX faults (page faults, PMD faults, page mkwrite and pfn mkwrite) from ext2 operations that modify a given inode's data block allocations. I've tested this using xfstests with DAX enabled and disabled and verified that it compiles without errors with and without CONFIG_FS_DAX. Changes from v1: - 'dax_sem' is now only present in struct ext2_inode_info if CONFIG_FS_DAX is defined. This was done to help save space on low-memory machines that are a target audience of ext2. (Jan) - The locking order between ext2_inode_info->dax_sem and sb_start_pagefault was swapped to match the locking order in XFS. This resulted in more open-coding of the various DAX fault routines, and once this is done in ext4 we should be able to get rid of many (all?) the DAX fault handler wrappers that do locking for the filesystems. (Dave) - Warn if 'dax_sem' isn't properly held in __ext2_truncate_blocks. (Dan) Ross Zwisler (2): dax: dax_pfn_mkwrite() truncate race check ext2: Add locking for DAX faults fs/dax.c | 13 +++++++-- fs/ext2/ext2.h | 11 ++++++++ fs/ext2/file.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- fs/ext2/inode.c | 10 +++++++ fs/ext2/super.c | 3 +++ 5 files changed, 115 insertions(+), 6 deletions(-) -- 2.1.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbbJMW0A (ORCPT ); Tue, 13 Oct 2015 18:26:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:4757 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbbJMWZ6 (ORCPT ); Tue, 13 Oct 2015 18:25:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,680,1437462000"; d="scan'208";a="791976718" From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Alexander Viro , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Dan Williams , Dave Chinner , "Kirill A. Shutemov" , linux-nvdimm@ml01.01.org, Matthew Wilcox Subject: [PATCH v2 0/2] Add updated DAX locking to ext2 Date: Tue, 13 Oct 2015 16:25:35 -0600 Message-Id: <1444775137-23685-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The first patch in this series is a somewhat related bug fix. The second patch adds new locking to ext2 to isolate DAX faults (page faults, PMD faults, page mkwrite and pfn mkwrite) from ext2 operations that modify a given inode's data block allocations. I've tested this using xfstests with DAX enabled and disabled and verified that it compiles without errors with and without CONFIG_FS_DAX. Changes from v1: - 'dax_sem' is now only present in struct ext2_inode_info if CONFIG_FS_DAX is defined. This was done to help save space on low-memory machines that are a target audience of ext2. (Jan) - The locking order between ext2_inode_info->dax_sem and sb_start_pagefault was swapped to match the locking order in XFS. This resulted in more open-coding of the various DAX fault routines, and once this is done in ext4 we should be able to get rid of many (all?) the DAX fault handler wrappers that do locking for the filesystems. (Dave) - Warn if 'dax_sem' isn't properly held in __ext2_truncate_blocks. (Dan) Ross Zwisler (2): dax: dax_pfn_mkwrite() truncate race check ext2: Add locking for DAX faults fs/dax.c | 13 +++++++-- fs/ext2/ext2.h | 11 ++++++++ fs/ext2/file.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- fs/ext2/inode.c | 10 +++++++ fs/ext2/super.c | 3 +++ 5 files changed, 115 insertions(+), 6 deletions(-) -- 2.1.0