summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2014-07-31 09:38:11 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-08-13 13:08:49 +1000
commitc2a82d010f3c76a88d75d20322aff5c1a4a99337 (patch)
tree5f16eb757cfb558956e4699eb3dc8eff017b103f
parentd385e3fd64170133463b25cd16acc58b513550a9 (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>
-rw-r--r--fs/fat/inode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index df4be1932f68..e45a3bbfe042 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -292,6 +292,13 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
loff_t size = offset + count;
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;
}
/*