From: Ross Zwisler Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() 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> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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 To: Ross Zwisler Return-path: In-Reply-To: <20160208014601.GB2343@linux.intel.com> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org > 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