From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH] Oversight in generic_file_aio_write_nolock Date: Tue, 07 Apr 2009 13:35:53 -0400 Message-ID: <49DB8EF9.2040301@garzik.org> References: <20090407161608.GA1514155@fiona.linuxhacker.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Oleg Drokin Return-path: Received: from srv5.dvmed.net ([207.36.208.214]:52130 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760119AbZDGRf5 (ORCPT ); Tue, 7 Apr 2009 13:35:57 -0400 In-Reply-To: <20090407161608.GA1514155@fiona.linuxhacker.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Oleg Drokin wrote: > Hello! > > There seems to be an oversight in generic_file_aio_write_nolock where > when we open inode with O_SYNC and O_APPEND, then after we are done the > writing, we flush wrong byterange from the file, from original offset for > number of bytes written, instead from the actual oppended offset. > This can lead to an unexpected data loss should the crash happen soon after > such a write was performed. > > Here is a simple fix, though perhaps we can just throw away the pos argument > from the ->aio_write prototype eventually. Could I ask that you CC patches like this to linux-kernel also? Jeff