Re: [RFC] odd thing in btrfs_file_aio_write()

2014-04-14 Thread Qu Wenruo
Original Message Subject: Re: [RFC] odd thing in btrfs_file_aio_write() From: Al Viro v...@zeniv.linux.org.uk To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2014年04月14日 13:08 On Mon, Apr 14, 2014 at 11:36:53AM +0800, Qu Wenruo wrote: IOW, is that if (start_pos i_size_read(inode

[RFC] odd thing in btrfs_file_aio_write()

2014-04-13 Thread Al Viro
end_pos = round_up(pos + iov-iov_len, root-sectorsize); added in commit 3ac0d7b96a268a98bd474cab8bce3a9f125aaccf Author: Qu Wenruo quwen...@cn.fujitsu.com Date: Thu Mar 27 02:51:58 2014 + btrfs: Change the expanding write sequence to fix snapshot related bug. doesn't

Re: [RFC] odd thing in btrfs_file_aio_write()

2014-04-13 Thread Qu Wenruo
Oh, that's my fault, I forgot that iov can be chained. I should use 'pos + count' instead. Thanks for pointing it out. Qu. Original Message Subject: [RFC] odd thing in btrfs_file_aio_write() From: Al Viro v...@zeniv.linux.org.uk To: Chris Mason c...@fb.com Date: 2014年04月14日

Re: [RFC] odd thing in btrfs_file_aio_write()

2014-04-13 Thread Al Viro
On Mon, Apr 14, 2014 at 10:35:08AM +0800, Qu Wenruo wrote: Oh, that's my fault, I forgot that iov can be chained. I should use 'pos + count' instead. BTW, will there be any difference if 10Mb write starts one byte before EOF? IOW, is that if (start_pos i_size_read(inode)) { in there correct

Re: [RFC] odd thing in btrfs_file_aio_write()

2014-04-13 Thread Qu Wenruo
Original Message Subject: Re: [RFC] odd thing in btrfs_file_aio_write() From: Al Viro v...@zeniv.linux.org.uk To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2014年04月14日 10:48 On Mon, Apr 14, 2014 at 10:35:08AM +0800, Qu Wenruo wrote: Oh, that's my fault, I forgot that iov can

Re: [RFC] odd thing in btrfs_file_aio_write()

2014-04-13 Thread Al Viro
On Mon, Apr 14, 2014 at 11:36:53AM +0800, Qu Wenruo wrote: IOW, is that if (start_pos i_size_read(inode)) { in there correct these days? And what'll happen if we hit e.g. an unmapped page in the middle of the data being written? That will result in short write, but will it truncate what's