Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94412a96 authored by OGAWA Hirofumi's avatar OGAWA Hirofumi Committed by Linus Torvalds
Browse files

[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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Acked-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 346fd59b
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -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
		 * But we must fill the remaining area or hole by nul for
		 * updating ->mmu_private.
		 * updating ->mmu_private.
		 *
		 * Return 0, and fallback to normal buffered write.
		 */
		 */
		loff_t size = offset + iov_length(iov, nr_segs);
		loff_t size = offset + iov_length(iov, nr_segs);
		if (MSDOS_I(inode)->mmu_private < size)
		if (MSDOS_I(inode)->mmu_private < size)
			return -EINVAL;
			return 0;
	}
	}


	/*
	/*