Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753915Ab2K2TPJ (ORCPT ); Thu, 29 Nov 2012 14:15:09 -0500 Received: from mx1.fusionio.com ([66.114.96.30]:47923 "EHLO mx1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570Ab2K2TPG (ORCPT ); Thu, 29 Nov 2012 14:15:06 -0500 X-ASG-Debug-ID: 1354216505-03d6a57f9b210180001-xx1T2L X-Barracuda-Envelope-From: clmason@fusionio.com Date: Thu, 29 Nov 2012 14:15:03 -0500 From: Chris Mason To: Linus Torvalds CC: Mikulas Patocka , Al Viro , Jens Axboe , Jeff Chua , Lai Jiangshan , Jan Kara , lkml , linux-fsdevel Subject: Re: [PATCH v2] Do a proper locking for mmap and block size change Message-ID: <20121129191503.GB3490@shiny> X-ASG-Orig-Subj: Re: [PATCH v2] Do a proper locking for mmap and block size change Mail-Followup-To: Chris Mason , Linus Torvalds , Mikulas Patocka , Al Viro , Jens Axboe , Jeff Chua , Lai Jiangshan , Jan Kara , lkml , linux-fsdevel References: <50B4B313.3030707@kernel.dk> <50B5CC5A.8060607@kernel.dk> <20121128194314.GF4939@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2011-07-01) X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1354216505 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.115623 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 35 On Thu, Nov 29, 2012 at 12:02:17PM -0700, Linus Torvalds wrote: > On Thu, Nov 29, 2012 at 9:19 AM, Linus Torvalds > wrote: > > > > I think I'll apply this for 3.7 (since it's too late to do anything > > fancier), and then for 3.8 I will rip out all the locking entirely, > > because looking at the fs/buffer.c patch I wrote up, it's all totally > > unnecessary. > > > > Adding a ACCESS_ONCE() to the read of the i_blkbits value (when > > creating new buffers) simply makes the whole locking thing pointless. > > Just make the page lock protect the block size, and make it per-page, > > and we're done. > > There's a 'block-dev' branch in my git tree, if you guys want to play > around with it. > > It actually reverts fs/block-dev.c back to the 3.6 state (except for > some whitespace damage that I refused to re-introduce), so that part > of the changes should be pretty safe and well tested. > > The fs/buffer.c changes, of course, are new. It's largely the same > patch I already sent out, with a small helper function to simplify it, > and to keep the whole ACCESS_ONCE() thing in just a single place. The fs/buffer.c part makes sense during a quick read. But fs/direct-io.c plays with i_blkbits too. The semaphore was fixing real bugs there. -chris -- 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/