Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651Ab2K2CNy (ORCPT ); Wed, 28 Nov 2012 21:13:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46775 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752836Ab2K2CNw (ORCPT ); Wed, 28 Nov 2012 21:13:52 -0500 Date: Wed, 28 Nov 2012 20:20:14 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file.rdu.redhat.com To: Linus Torvalds cc: Jens Axboe , Jeff Chua , Lai Jiangshan , Jan Kara , lkml , linux-fsdevel , Neil Brown Subject: Re: [PATCH] Introduce a method to catch mmap_region (was: Recent kernel "mount" slow) In-Reply-To: Message-ID: References: <50B46E05.70906@kernel.dk> <50B4B313.3030707@kernel.dk> <50B5CC5A.8060607@kernel.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1330 Lines: 32 On Wed, 28 Nov 2012, Linus Torvalds wrote: > A bigger issue is for things that emulate what blkdev.c does, and > doesn't do the locking. I see code in md/bitmap.c that seems a bit > suspicious, for example. That said, it's not *new* breakage, and the > "lock at mmap/read/write() time" approach doesn't fix it either (since > the mapping will be different for the underlying MD device). So I do > think that we should take a look at all the users of > "alloc_page_buffers()" and "create_empty_buffers()" to see what *they* > do to protect the block-size, but I think that's an independent issue > from the raw device access case in fs/block_dev.c.. > > I guess I have to actually test my patch. I don't have very > interesting test-cases, though. > > Linus Yes, it md looks suspicious. It disables write access in deny_bitmap_write_access (that functions looks buggy on its own - what happens if i_writecount == 0 or if it is already negative on entry?). So we could disallow changing block size if i_writecount < 0, that should do the trick. Mikulas -- 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/