linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: matthew.r.wilcox@intel.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org
Subject: Re: [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions
Date: Fri, 14 Aug 2015 16:55:28 -0400	[thread overview]
Message-ID: <x49a8ttzj27.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <A631E1AA-B8E5-43EF-8EF6-76E056F46429@dilger.ca> (Andreas Dilger's message of "Fri, 14 Aug 2015 14:46:04 -0600")

Andreas Dilger <adilger@dilger.ca> writes:

> On Aug 14, 2015, at 2:15 PM, Jeff Moyer <jmoyer@redhat.com> wrote:
>> 
>> The dax code doesn't currently support misaligned partitions,
>> so disable O_DIRECT via dax until such time as that support
>> materializes.
>> 
>> Suggested-by: Boaz Harrosh <boaz@plexistor.com>
>> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>> ---
>> fs/block_dev.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>> 
>> diff --git a/fs/block_dev.c b/fs/block_dev.c
>> index 1982437..1170f8c 100644
>> --- a/fs/block_dev.c
>> +++ b/fs/block_dev.c
>> @@ -1241,6 +1241,13 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>> 				goto out_clear;
>> 			}
>> 			bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
>> +			/*
>> +			 * If the partition is not aligned on a page
>> +			 * boundary, we can't do dax I/O to it.
>> +			 */
>> +			if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) ||
>> +			    (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
>
> Maybe I'm missing something, but doesn't the second condition above
> disable DAX for the case that the 1/2 patch is fixing (i.e. the last
> sectors at the end of a non-PAGE_SIZE-multiple device)?  It seems a
> shame to disable DAX for the whole device because of the last sector.

No.  Patch 1/2 fixes a 512 byte read of the last sector of a properly
aligned partiton.  The goal is to eventually fix things so we can enable
the dax path for misaligned partitions, but it's not going to happen in
time for 4.2.  Also, keep in mind that this is just for opening the
block device itself with O_DIRECT.

Thanks for taking a look.

Cheers,
Jeff

  reply	other threads:[~2015-08-14 20:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 20:15 [PATCH 0/2] fix regression in direct I/O to pmem devices Jeff Moyer
2015-08-14 20:15 ` [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev Jeff Moyer
2015-08-14 20:53   ` Linda Knippers
2015-09-08 16:10     ` Linda Knippers
2015-09-08 16:23       ` Dan Williams
2015-08-14 20:15 ` [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions Jeff Moyer
2015-08-14 20:46   ` Andreas Dilger
2015-08-14 20:55     ` Jeff Moyer [this message]
2015-08-14 20:22 ` [PATCH 0/2] fix regression in direct I/O to pmem devices Dan Williams
2015-08-14 20:23   ` Dan Williams
2015-08-14 20:27     ` Jeff Moyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x49a8ttzj27.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=matthew.r.wilcox@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).