From patchwork Wed Sep 29 08:19:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 216622 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8T8KloF030166 for ; Wed, 29 Sep 2010 08:20:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754597Ab0I2IUU (ORCPT ); Wed, 29 Sep 2010 04:20:20 -0400 Received: from verein.lst.de ([213.95.11.210]:52401 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178Ab0I2IUR (ORCPT ); Wed, 29 Sep 2010 04:20:17 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id o8T8Jd88023412 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 29 Sep 2010 10:19:39 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id o8T8Ja1a023411; Wed, 29 Sep 2010 10:19:36 +0200 Date: Wed, 29 Sep 2010 10:19:36 +0200 From: Christoph Hellwig To: Chris Mason , Jan Kara , Cesar Eduardo Barros , Andrew Morton , hch@lst.de, linux-kernel@vger.kernel.org, Jens Axboe , linux-btrfs@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, stable@kernel.org, Jens Axboe , Micha?? Piotrowski , Chuck Ebbert , kernel@lists.fedoraproject.org Subject: Re: Dirtiable inode bdi default != sb bdi btrfs Message-ID: <20100929081936.GA23322@lst.de> References: <4C9AA546.6050201@cesarb.net> <20100923123849.8975fe47.akpm@linux-foundation.org> <20100927222548.GG3610@quack.suse.cz> <20100927225452.GG4270@think> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100927225452.GG4270@think> User-Agent: Mutt/1.3.28i X-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.39 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Sep 2010 08:20:48 +0000 (UTC) Index: linux-2.6/fs/fs-writeback.c =================================================================== --- linux-2.6.orig/fs/fs-writeback.c 2010-09-29 16:58:41.750557721 +0900 +++ linux-2.6/fs/fs-writeback.c 2010-09-29 17:11:35.040557719 +0900 @@ -72,22 +72,10 @@ int writeback_in_progress(struct backing static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) { struct super_block *sb = inode->i_sb; - struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; - /* - * For inodes on standard filesystems, we use superblock's bdi. For - * inodes on virtual filesystems, we want to use inode mapping's bdi - * because they can possibly point to something useful (think about - * block_dev filesystem). - */ - if (sb->s_bdi && sb->s_bdi != &noop_backing_dev_info) { - /* Some device inodes could play dirty tricks. Catch them... */ - WARN(bdi != sb->s_bdi && bdi_cap_writeback_dirty(bdi), - "Dirtiable inode bdi %s != sb bdi %s\n", - bdi->name, sb->s_bdi->name); - return sb->s_bdi; - } - return bdi; + if (strcmp(sb->s_type->name, "bdev") == 0) + return inode->i_mapping->backing_dev_info; + return sb->s_bdi; } static void bdi_queue_work(struct backing_dev_info *bdi,