Skip to content

Commit

Permalink
[PATCH] FAT: DIO-write fallback to normal buffered
Browse files Browse the repository at this point in the history
If the DIO write on FAT is expanding the size, it will be fail by -EINVAL,
because FAT can't handle it now.

This patch fallback it to the normal buffered-write and would return
success.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
OGAWA Hirofumi authored and Linus Torvalds committed Feb 21, 2007
1 parent 346fd59 commit 94412a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
*
* But we must fill the remaining area or hole by nul for
* updating ->mmu_private.
*
* Return 0, and fallback to normal buffered write.
*/
loff_t size = offset + iov_length(iov, nr_segs);
if (MSDOS_I(inode)->mmu_private < size)
return -EINVAL;
return 0;
}

/*
Expand Down

0 comments on commit 94412a9

Please sign in to comment.