Tao Ma
ae55e1aaa7
fs/direct-io.c: calculate fs_count correctly in get_more_blocks()
...
In get_more_blocks(), we use dio_count to calcuate fs_count and do some
tricky things to increase fs_count if dio_count isn't aligned. But
actually it still has some corner cases that can't be coverd. See the
following example:
dio_write foo -s 1024 -w 4096
(direct write 4096 bytes at offset 1024). The same goes if the offset
isn't aligned to fs_blocksize.
In this case, the old calculation counts fs_count to be 1, but actually we
will write into 2 different blocks (if fs_blocksize=4096). The old code
just works, since it will call get_block twice (and may have to allocate
and create extents twice for filesystems like ext4). So we'd better call
get_block just once with the proper fs_count.
Signed-off-by: Tao Ma <boyu.mt@taobao.com >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Christoph Hellwig <hch@lst.de >
Cc: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2012-01-12 20:13:12 -08:00
..
2012-01-10 15:09:01 -08:00
2012-01-06 23:19:54 -05:00
2012-01-03 22:55:04 -05:00
2012-01-03 22:54:53 -05:00
2012-01-11 00:20:12 -05:00
2012-01-03 22:52:40 -05:00
2012-01-03 22:54:53 -05:00
2012-01-12 20:13:09 -08:00
2012-01-03 22:54:07 -05:00
2012-01-09 16:36:12 -05:00
2012-01-08 12:19:57 -08:00
2012-01-10 11:13:16 -05:00
2012-01-03 22:54:57 -05:00
2012-01-06 23:15:54 -05:00
2012-01-08 12:19:57 -08:00
2012-01-08 20:19:03 -05:00
2012-01-10 14:55:55 -08:00
2012-01-06 23:19:54 -05:00
2012-01-03 22:52:40 -05:00
2012-01-09 12:51:01 -08:00
2012-01-09 12:51:21 -08:00
2012-01-09 12:51:21 -08:00
2012-01-10 11:54:07 -05:00
2012-01-09 12:09:47 -08:00
2012-01-03 22:55:10 -05:00
2012-01-06 23:19:54 -05:00
2012-01-10 14:55:55 -08:00
2012-01-06 23:19:54 -05:00
2012-01-10 17:48:52 -05:00
2012-01-06 23:19:54 -05:00
2012-01-03 22:54:54 -05:00
2012-01-03 22:52:41 -05:00
2012-01-12 20:13:09 -08:00
2012-01-09 10:48:11 -05:00
2012-01-09 12:51:21 -08:00
2012-01-10 11:54:07 -05:00
2012-01-10 13:45:22 -08:00
2012-01-08 13:10:57 -08:00
2012-01-06 23:16:53 -05:00
2012-01-10 13:45:22 -08:00
2012-01-08 12:19:57 -08:00
2012-01-06 23:19:54 -05:00
2012-01-12 20:13:09 -08:00
2012-01-10 14:57:40 -08:00
2012-01-08 13:10:57 -08:00
2011-11-26 19:58:47 -08:00
2012-01-03 22:57:12 -05:00
2012-01-06 23:19:54 -05:00
2012-01-10 14:55:55 -08:00
2012-01-03 22:55:01 -05:00
2012-01-03 22:52:40 -05:00
2012-01-12 20:13:02 -08:00
2011-11-18 13:49:00 -08:00
2012-01-08 13:21:22 -08:00
2012-01-06 23:16:53 -05:00
2012-01-03 22:55:07 -05:00
2012-01-10 16:30:54 -08:00
2012-01-10 13:45:22 -08:00
2012-01-03 22:52:40 -05:00
2012-01-03 22:55:03 -05:00
2012-01-06 23:16:53 -05:00
2012-01-10 14:57:19 -08:00
2012-01-09 12:51:21 -08:00
2012-01-06 23:19:54 -05:00
2012-01-09 12:50:15 -08:00
2012-01-03 22:55:11 -05:00
2012-01-03 22:54:54 -05:00
2012-01-10 16:30:51 -08:00
2012-01-06 23:16:53 -05:00
2011-11-16 09:21:50 +01:00
2012-01-10 13:08:55 -05:00
2012-01-03 22:54:07 -05:00
2011-12-13 11:18:17 -08:00
2012-01-05 15:40:12 -08:00
2012-01-03 22:55:19 -05:00
2012-01-10 13:06:32 -05:00
2012-01-12 20:13:12 -08:00
2012-01-12 20:13:04 -08:00
2012-01-10 16:30:44 -08:00
2012-01-06 23:16:53 -05:00
2012-01-06 23:20:13 -05:00
2012-01-03 22:52:39 -05:00
2012-01-10 16:59:59 -08:00
2012-01-10 16:30:42 -08:00
2012-01-06 23:20:12 -05:00
2012-01-05 15:40:12 -08:00
2012-01-09 12:51:01 -08:00
2012-01-10 16:30:51 -08:00
2012-01-03 22:54:07 -05:00
2011-12-26 10:25:26 -08:00
2012-01-06 23:15:54 -05:00
2012-01-06 23:20:12 -05:00
2012-01-06 23:15:54 -05:00
2012-01-08 13:21:22 -08:00
2012-01-06 23:16:53 -05:00
2012-01-12 20:13:04 -08:00
2012-01-03 22:57:11 -05:00
2012-01-03 22:57:11 -05:00
2012-01-06 23:19:54 -05:00
2012-01-03 22:52:40 -05:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:53:07 -05:00
2012-01-06 23:20:13 -05:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:52:40 -05:00