From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() From: Ross Zwisler In-Reply-To: <20160208014601.GB2343@linux.intel.com> Date: Sun, 7 Feb 2016 21:29:38 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <00FE872A-9B2A-4492-A83C-59025ACB1F4A@gmail.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160208014601.GB2343@linux.intel.com> Sender: owner-linux-mm@kvack.org To: Ross Zwisler Cc: Dan Williams , Theodore Ts'o , "linux-nvdimm@lists.01.org" , Dave Chinner , "linux-kernel@vger.kernel.org" , XFS Developers , Linux MM , Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel , linux-ext4 , Andrew Morton List-ID: > On Feb 7, 2016, at 6:46 PM, Ross Zwisler wr= ote: >=20 >> On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler >> wrote: >>> dax_clear_blocks() needs a valid struct block_device and previously it w= as >>> using inode->i_sb->s_bdev in all cases. This is correct for normal inod= es >>> on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >>> block devices and for XFS real-time devices. >>>=20 >>> Instead, have the caller pass in a struct block_device pointer which it >>> knows to be correct. >>>=20 >>> Signed-off-by: Ross Zwisler >>> --- >>> fs/dax.c | 4 ++-- >>> fs/ext2/inode.c | 5 +++-- >>> fs/xfs/xfs_aops.c | 2 +- >>> fs/xfs/xfs_aops.h | 1 + >>> fs/xfs/xfs_bmap_util.c | 4 +++- >>> include/linux/dax.h | 3 ++- >>> 6 files changed, 12 insertions(+), 7 deletions(-) >>>=20 >>> diff --git a/fs/dax.c b/fs/dax.c >>> index 227974a..4592241 100644 >>> --- a/fs/dax.c >>> +++ b/fs/dax.c >>> @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev= , sector_t n) >>> * and hence this means the stack from this point must follow GFP_NOFS >>> * semantics for all operations. >>> */ >>> -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) >>> +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, >>> + sector_t block, long _size) >>=20 >> Since this is a bdev relative routine we should also resolve the >> sector, i.e. the signature should drop the inode: >>=20 >> int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _s= ize) >=20 > The inode is still needed because dax_clear_blocks() needs inode->i_blkbit= s. > Unless there is some easy way to get this from the bdev that I'm not seein= g? Never mind, you are passing in the sector, not the block. Sure, this seems b= etter - I'll fix this for v2.= -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755290AbcBHE3n (ORCPT ); Sun, 7 Feb 2016 23:29:43 -0500 Received: from mail-ob0-f195.google.com ([209.85.214.195]:34223 "EHLO mail-ob0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753052AbcBHE3l convert rfc822-to-8bit (ORCPT ); Sun, 7 Feb 2016 23:29:41 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() From: Ross Zwisler X-Mailer: iPad Mail (13D15) In-Reply-To: <20160208014601.GB2343@linux.intel.com> Date: Sun, 7 Feb 2016 21:29:38 -0700 Cc: Dan Williams , "Theodore Ts'o" , "linux-nvdimm@lists.01.org" , Dave Chinner , "linux-kernel@vger.kernel.org" , XFS Developers , Linux MM , Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel , linux-ext4 , Andrew Morton Content-Transfer-Encoding: 8BIT Message-Id: <00FE872A-9B2A-4492-A83C-59025ACB1F4A@gmail.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160208014601.GB2343@linux.intel.com> To: Ross Zwisler Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 7, 2016, at 6:46 PM, Ross Zwisler wrote: > >> On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler >> wrote: >>> dax_clear_blocks() needs a valid struct block_device and previously it was >>> using inode->i_sb->s_bdev in all cases. This is correct for normal inodes >>> on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >>> block devices and for XFS real-time devices. >>> >>> Instead, have the caller pass in a struct block_device pointer which it >>> knows to be correct. >>> >>> Signed-off-by: Ross Zwisler >>> --- >>> fs/dax.c | 4 ++-- >>> fs/ext2/inode.c | 5 +++-- >>> fs/xfs/xfs_aops.c | 2 +- >>> fs/xfs/xfs_aops.h | 1 + >>> fs/xfs/xfs_bmap_util.c | 4 +++- >>> include/linux/dax.h | 3 ++- >>> 6 files changed, 12 insertions(+), 7 deletions(-) >>> >>> diff --git a/fs/dax.c b/fs/dax.c >>> index 227974a..4592241 100644 >>> --- a/fs/dax.c >>> +++ b/fs/dax.c >>> @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) >>> * and hence this means the stack from this point must follow GFP_NOFS >>> * semantics for all operations. >>> */ >>> -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) >>> +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, >>> + sector_t block, long _size) >> >> Since this is a bdev relative routine we should also resolve the >> sector, i.e. the signature should drop the inode: >> >> int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _size) > > The inode is still needed because dax_clear_blocks() needs inode->i_blkbits. > Unless there is some easy way to get this from the bdev that I'm not seeing? Never mind, you are passing in the sector, not the block. Sure, this seems better - I'll fix this for v2. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B30047CAA for ; Sun, 7 Feb 2016 22:29:41 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id A24A88F8035 for ; Sun, 7 Feb 2016 20:29:41 -0800 (PST) Received: from mail-ob0-f195.google.com (mail-ob0-f195.google.com [209.85.214.195]) by cuda.sgi.com with ESMTP id 5yIlblzCKU35Wa5E (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 20:29:40 -0800 (PST) Received: by mail-ob0-f195.google.com with SMTP id wg8so7338132obc.3 for ; Sun, 07 Feb 2016 20:29:40 -0800 (PST) Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() From: Ross Zwisler In-Reply-To: <20160208014601.GB2343@linux.intel.com> Date: Sun, 7 Feb 2016 21:29:38 -0700 Message-Id: <00FE872A-9B2A-4492-A83C-59025ACB1F4A@gmail.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160208014601.GB2343@linux.intel.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Ross Zwisler Cc: Theodore Ts'o , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , XFS Developers , Linux MM , Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel , Dan Williams , linux-ext4 , Andrew Morton > On Feb 7, 2016, at 6:46 PM, Ross Zwisler wrote: > >> On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler >> wrote: >>> dax_clear_blocks() needs a valid struct block_device and previously it was >>> using inode->i_sb->s_bdev in all cases. This is correct for normal inodes >>> on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >>> block devices and for XFS real-time devices. >>> >>> Instead, have the caller pass in a struct block_device pointer which it >>> knows to be correct. >>> >>> Signed-off-by: Ross Zwisler >>> --- >>> fs/dax.c | 4 ++-- >>> fs/ext2/inode.c | 5 +++-- >>> fs/xfs/xfs_aops.c | 2 +- >>> fs/xfs/xfs_aops.h | 1 + >>> fs/xfs/xfs_bmap_util.c | 4 +++- >>> include/linux/dax.h | 3 ++- >>> 6 files changed, 12 insertions(+), 7 deletions(-) >>> >>> diff --git a/fs/dax.c b/fs/dax.c >>> index 227974a..4592241 100644 >>> --- a/fs/dax.c >>> +++ b/fs/dax.c >>> @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) >>> * and hence this means the stack from this point must follow GFP_NOFS >>> * semantics for all operations. >>> */ >>> -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) >>> +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, >>> + sector_t block, long _size) >> >> Since this is a bdev relative routine we should also resolve the >> sector, i.e. the signature should drop the inode: >> >> int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _size) > > The inode is still needed because dax_clear_blocks() needs inode->i_blkbits. > Unless there is some easy way to get this from the bdev that I'm not seeing? Never mind, you are passing in the sector, not the block. Sure, this seems better - I'll fix this for v2. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs