summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2013-11-05 16:57:32 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2013-11-05 16:57:32 +1100
commit63bb2c6900b8d3911cc6e7d428b6745f897b4649 (patch)
treef6d11fdc9c04c9d15607d86dfc27052753f05c6c /fs
parentd45d5c0fdbb6f1bd99e8634d448d139521cc18c1 (diff)
fat: fallback to buffered write in case of fallocatded 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 5ee94238c5dd..0103e7fa00cd 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -218,6 +218,14 @@ 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 >
+ round_up(i_size_read(inode), inode->i_sb->s_blocksize))
+ return 0;
}
/*