From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755071Ab2AXIVZ (ORCPT ); Tue, 24 Jan 2012 03:21:25 -0500 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:3496 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972Ab2AXIVX (ORCPT ); Tue, 24 Jan 2012 03:21:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAABnHk95LElR/2dsb2JhbABDriuBBoFyAQEFOhwjEAgDDgouFCUDIRPAQhOMEwSVF4kqiTg Date: Tue, 24 Jan 2012 19:21:19 +1100 From: Dave Chinner To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, Eric Sandeen , Dave Chinner , Surbhi Palande , Kamal Mostafa , Christoph Hellwig , LKML , xfs@oss.sgi.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH 2/8] vfs: Protect write paths by sb_start_write - sb_end_write Message-ID: <20120124082119.GO15102@dastard> References: <1327091686-23177-1-git-send-email-jack@suse.cz> <1327091686-23177-3-git-send-email-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1327091686-23177-3-git-send-email-jack@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2012 at 09:34:40PM +0100, Jan Kara wrote: > There are three entry points which dirty pages in a filesystem. mmap (handled > by block_page_mkwrite()), buffered write (handled by > __generic_file_aio_write()), and truncate (it can dirty last partial page - > handled inside each filesystem separately). Protect these places with > sb_start_write() and sb_end_write(). fallocate can also dirty pages, either during preallocation or hole punching. Hence if you are going to promote truncate to SB_FREEZE_WRITE protection then you need to promote everything else that can zero partial blocks as well. That also means that anything the has implemented XFS_IOC_ ioctl interfaces for prellocation and hole punching (xfs, ocfs2 and gfs2 IIRC) also needs to be protected in the same way. Cheers, Dave. -- Dave Chinner david@fromorbit.com