Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1328761

Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks()

From Ross Zwisler <zwisler@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks()
Date 2016-02-08 05:40 +0100
Message-ID <qZLMe-8px-5@gated-at.bofh.it> (permalink)
References <qZrNv-2K8-9@gated-at.bofh.it> <qZrXc-2O5-3@gated-at.bofh.it> <qZC6f-1yh-39@gated-at.bofh.it> <qZJ7I-6rS-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> On Feb 7, 2016, at 6:46 PM, Ross Zwisler <ross.zwisler@linux.intel.com> 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
>> <ross.zwisler@linux.intel.com> 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 <ross.zwisler@linux.intel.com>
>>> ---
>>> 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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] DAX bdev fixes - move flushing calls to FS Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-07 08:20 +0100
  [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-07 08:30 +0100
    Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dan Williams <dan.j.williams@intel.com> - 2016-02-07 19:20 +0100
      Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 02:50 +0100
        Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <zwisler@gmail.com> - 2016-02-08 05:40 +0100
    Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dave Chinner <david@fromorbit.com> - 2016-02-07 23:10 +0100
      Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 02:50 +0100
        Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dave Chinner <david@fromorbit.com> - 2016-02-08 06:20 +0100
          Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 16:40 +0100

csiph-web