From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC] odd thing in btrfs_file_aio_write() Date: Mon, 14 Apr 2014 03:48:30 +0100 Message-ID: <20140414024830.GR18016@ZenIV.linux.org.uk> References: <20140414002625.GQ18016@ZenIV.linux.org.uk> <534B495C.6060504@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Mason , linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Qu Wenruo Return-path: Content-Disposition: inline In-Reply-To: <534B495C.6060504@cn.fujitsu.com> Sender: linux-btrfs-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 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 left of that dummy range?