LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Direct IO for fat
@ 2007-02-08 11:28 Jan Kara
  2007-02-08 15:44 ` OGAWA Hirofumi
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kara @ 2007-02-08 11:28 UTC (permalink / raw)
  To: hirofumi; +Cc: linux-kernel

  Hello,

  I've noticed that extending a file using direct IO fails for FAT with
EINVAL. It's basically because of the following code in fat_direct_IO():

if (rw == WRITE) {
        /*
         * FIXME: blockdev_direct_IO() doesn't use
         * ->prepare_write(),
         * so we need to update the ->mmu_private to block
         * boundary.
         *
         * But we must fill the remaining area or hole by nul for
         * updating ->mmu_private.
         */
        loff_t size = offset + iov_length(iov, nr_segs);
        if (MSDOS_I(inode)->mmu_private < size)
                return -EINVAL;
}

  But isn't this check bogus? blockdev_direct_IO writes only to space that
is already allocated and stops as soon as it needs to extend the file
(further extension is then handled by buffered writes). So it should
already do what it needed for FAT. Thanks for an answer in advance.

									Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-02-09 13:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 11:28 Direct IO for fat 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
2007-02-09  7:19             ` Jan Kara
2007-02-09 13:42               ` OGAWA Hirofumi

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