From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cn.fujitsu.com ([59.151.112.132]:14049 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750770AbaDNDfy convert rfc822-to-8bit (ORCPT ); Sun, 13 Apr 2014 23:35:54 -0400 Message-ID: <534B57D5.9070901@cn.fujitsu.com> Date: Mon, 14 Apr 2014 11:36:53 +0800 From: Qu Wenruo MIME-Version: 1.0 To: Al Viro CC: Chris Mason , , Subject: Re: [RFC] odd thing in btrfs_file_aio_write() References: <20140414002625.GQ18016@ZenIV.linux.org.uk> <534B495C.6060504@cn.fujitsu.com> <20140414024830.GR18016@ZenIV.linux.org.uk> In-Reply-To: <20140414024830.GR18016@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8"; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: -------- Original Message -------- Subject: Re: [RFC] odd thing in btrfs_file_aio_write() From: Al Viro To: Qu Wenruo 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 be chained. >> >> I should use 'pos + count' instead. > BTW, will there be any difference if 10Mb write starts one byte before EOF? This will not be a problem, since btrfs will not update the inode size until the data is written. So this behavior will not cause empty gap. > 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? I'm very sorry for my poor that I could not understand the question well. Would you please explain what does the "unmapped page" means? Did you mean two noncontinuous iovecs? If you did mean that, it seems that I should expand the end_pos to the end of the iovec... Thanks, Qu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Qu Wenruo Subject: Re: [RFC] odd thing in btrfs_file_aio_write() Date: Mon, 14 Apr 2014 11:36:53 +0800 Message-ID: <534B57D5.9070901@cn.fujitsu.com> References: <20140414002625.GQ18016@ZenIV.linux.org.uk> <534B495C.6060504@cn.fujitsu.com> <20140414024830.GR18016@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Chris Mason , , To: Al Viro Return-path: Received: from cn.fujitsu.com ([59.151.112.132]:14049 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750770AbaDNDfy convert rfc822-to-8bit (ORCPT ); Sun, 13 Apr 2014 23:35:54 -0400 In-Reply-To: <20140414024830.GR18016@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: -------- Original Message -------- Subject: Re: [RFC] odd thing in btrfs_file_aio_write() =46rom: Al Viro To: Qu Wenruo Date: 2014=E5=B9=B404=E6=9C=8814=E6=97=A5 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 be chained. >> >> I should use 'pos + count' instead. > BTW, will there be any difference if 10Mb write starts one byte befor= e EOF? This will not be a problem, since btrfs will not update the inode size=20 until the data is written. So this behavior will not cause empty gap. > 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 th= e > middle of the data being written? That will result in short write, b= ut > will it truncate what's left of that dummy range? I'm very sorry for my poor that I could not understand the question wel= l. Would you please explain what does the "unmapped page" means? Did you mean two noncontinuous iovecs? If you did mean that, it seems that I should expand the end_pos to the=20 end of the iovec... Thanks, Qu -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html