Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] FAT: DIO-write fallback to normal buffered

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>

authored by

OGAWA Hirofumi and committed by
Linus Torvalds
94412a96 346fd59b

+3 -1
+3 -1
fs/fat/inode.c
··· 173 173 * 174 174 * But we must fill the remaining area or hole by nul for 175 175 * updating ->mmu_private. 176 + * 177 + * Return 0, and fallback to normal buffered write. 176 178 */ 177 179 loff_t size = offset + iov_length(iov, nr_segs); 178 180 if (MSDOS_I(inode)->mmu_private < size) 179 - return -EINVAL; 181 + return 0; 180 182 } 181 183 182 184 /*