diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2014-01-10 12:41:58 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-01-10 12:41:58 +1100 |
commit | 04a80f788260fd704135980a7a95aac07ab3aff7 (patch) | |
tree | 80f0ab5be2694f0a98ecfbc75fbfba023db11bae /fs | |
parent | d12782c4b6df2918bfb714155d5aa3606b144b9a (diff) |
fat: fallback to buffered write in case of fallocated region on direct IO
For normal cases of direct IO write, trying to seek to location greater
than file size, makes it fall back to buffered write to fill that region.
Similarly, in case for write in Fallocated region, make it fall to
buffered write.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/inode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 980e44bb9de6..6b3e203ff126 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -229,6 +229,13 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, loff_t size = offset + iov_length(iov, nr_segs); if (MSDOS_I(inode)->mmu_private < size) return 0; + + /* + * In case of writing in fallocated region, return 0 and + * fallback to buffered write. + */ + if (MSDOS_I(inode)->i_disksize > MSDOS_I(inode)->mmu_private) + return 0; } /* |