* [PATCH v3 4/6] fat: fallback to buffered write in case of fallocated region on direct IO
@ 2013-12-25 6:31 Namjae Jeon
0 siblings, 0 replies; only message in thread
From: Namjae Jeon @ 2013-12-25 6:31 UTC (permalink / raw)
To: hirofumi, akpm
Cc: linux-fsdevel, linux-kernel, Namjae Jeon, Namjae Jeon,
Amit Sahrawat
From: Namjae Jeon <namjae.jeon@samsung.com>
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>
---
fs/fat/inode.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8415807..3636617 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;
}
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-12-25 6:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-25 6:31 [PATCH v3 4/6] fat: fallback to buffered write in case of fallocated region on direct IO Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).