From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [patch 2/4] fs: fsync inode dirty race fix Date: Mon, 22 Nov 2010 08:23:18 -0500 Message-ID: <20101122132318.GB25321@infradead.org> References: <20101122130507.GC12716@amd> <20101122130637.GD12716@amd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:49531 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754583Ab0KVNXT (ORCPT ); Mon, 22 Nov 2010 08:23:19 -0500 Content-Disposition: inline In-Reply-To: <20101122130637.GD12716@amd> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > ret = sync_mapping_buffers(inode->i_mapping); > - if (!(inode->i_state & I_DIRTY)) > - return ret; > - if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) > - return ret; > - > > err = sync_inode_metadata(inode, 1); This makes fdatasync equivalent to fsync, which means a huge drop in performance for database an virtualization performance. I think the right aproach is to extend the sync_inode_metadata to writeback_single_inode chain with a datasync parameter so that we can do the correct decision there. Note that there are a lot more fsync implementations than just generic_file_fsync and exofs_fsync that have the same issue.