LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Jan Kara <jack@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Direct IO for fat
Date: Fri, 09 Feb 2007 04:53:02 +0900	[thread overview]
Message-ID: <873b5g2zq9.fsf@duaron.myhome.or.jp> (raw)
In-Reply-To: <20070208184104.GA24986@atrey.karlin.mff.cuni.cz> (Jan Kara's message of "Thu\, 8 Feb 2007 19\:41\:04 +0100")

Jan Kara <jack@suse.cz> writes:

>> > -> blockdev_direct_IO()
>> >   -> direct_io_worker()
>> >     -> do_direct_IO()
>> >       -> get_more_blocks()
>> > 
>> > 		create = dio->rw & WRITE;
>>   Here, create == 1.
>> 
>> > 		if (dio->lock_type == DIO_LOCKING) {
>> > 			if (dio->block_in_file < (i_size_read(dio->inode) >>
>> > 							dio->blkbits))
>> > 				create = 0;
>>   But here create was reset back to 0 - exactly because
>> dio->block_in_file > i_size...
>   Obviously, I'm blind and you're right ;) This test is not satisfied
> and so create == 1.
>   But still it would seem better to me to return 0 from fat_direct_IO()
> instead of EINVAL so that write falls back to a buffered one, instead
> returning the error...

I see. When I wrote this, I thought kernel should use DIO to write if
user sets O_DIRECT. Because the wrong alignment request isn't fallback
to buffered-write, and it's also returns EINVAL.

But I don't have strong opinion here. If anyone (you) has any request
of it, I'll not have objection to it.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2007-02-08 19:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 11:28 Jan Kara
2007-02-08 15:44 ` OGAWA Hirofumi
2007-02-08 16:10   ` Jan Kara
2007-02-08 16:40     ` OGAWA Hirofumi
2007-02-08 17:35       ` Jan Kara
2007-02-08 18:41         ` Jan Kara
2007-02-08 19:53           ` OGAWA Hirofumi [this message]
2007-02-09  7:19             ` Jan Kara
2007-02-09 13:42               ` OGAWA Hirofumi

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=873b5g2zq9.fsf@duaron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Direct IO for fat' \
    /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

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).