Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754773Ab2K2Sq3 (ORCPT ); Thu, 29 Nov 2012 13:46:29 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:50587 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754704Ab2K2Sq1 (ORCPT ); Thu, 29 Nov 2012 13:46:27 -0500 MIME-Version: 1.0 In-Reply-To: References: <50B46E05.70906@kernel.dk> <50B4B313.3030707@kernel.dk> <50B5CC5A.8060607@kernel.dk> <20121128194314.GF4939@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 29 Nov 2012 10:46:06 -0800 X-Google-Sender-Auth: i3GxHNEhkCjWeB826pPJ2S-t5v8 Message-ID: Subject: Re: [PATCH v2] Do a proper locking for mmap and block size change To: Mikulas Patocka Cc: Al Viro , Jens Axboe , Jeff Chua , Lai Jiangshan , Jan Kara , lkml , linux-fsdevel Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 28 On Thu, Nov 29, 2012 at 10:23 AM, Mikulas Patocka wrote: > > > If you remove that percpu rw lock, you also need to rewrite direct i/o > code. > > In theory, block device direct i/o doesn't need buffer block size at all. > But in practice, it shares a lot of code with filesystem direct i/o, it > reads the block size multiple times and it crashes if it changes. If it's a filesystem, then the size will never change while it is mounted. So only the direct-block-device case needs to be worried about, no? And that uses __generic_file_aio_write() and friends, which in turn use the readpage/writepage functions. So for block devices, it should be sufficient to make readpage/writepage (with the writing obviously having all the "write_begin/write_end/fullpage" variants) be safe as far as I can see. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/