[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1393769361-3574-1-git-send-email-linkinjeon@gmail.com>
Date: Sun, 2 Mar 2014 23:09:21 +0900
From: Namjae Jeon <linkinjeon@...il.com>
To: hirofumi@...l.parknet.co.jp, akpm@...ux-foundation.org
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Namjae Jeon <linkinjeon@...il.com>,
Namjae Jeon <namjae.jeon@...sung.com>,
Amit Sahrawat <a.sahrawat@...sung.com>
Subject: [PATCH v4 4/6] fat: fallback to buffered write in case of fallocated region on direct IO
From: Namjae Jeon <namjae.jeon@...sung.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@...sung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@...sung.com>
---
fs/fat/inode.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index a594dae..9509d07 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.11-rc0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists