From patchwork Fri Feb 18 20:18:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Mason X-Patchwork-Id: 573931 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 p1IKLo7v008422 for ; Fri, 18 Feb 2011 20:21:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757848Ab1BRUVr (ORCPT ); Fri, 18 Feb 2011 15:21:47 -0500 Received: from rcsinet10.oracle.com ([148.87.113.121]:46771 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732Ab1BRUVr (ORCPT ); Fri, 18 Feb 2011 15:21:47 -0500 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p1IKJS4S025646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Feb 2011 20:19:30 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p1IIMw9u004779; Fri, 18 Feb 2011 20:19:27 GMT Received: from abhmt012.oracle.com by acsmt353.oracle.com with ESMTP id 1019446511298060333; Fri, 18 Feb 2011 12:18:53 -0800 Received: from localhost (/66.66.148.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Feb 2011 12:18:53 -0800 From: Chris Mason To: Andrew Morton Cc: David Sterba , linux-btrfs , bugzilla-daemon , bugme-daemon , fox Subject: Re: [Bugme-new] [Bug 29302] New: Null pointer dereference with large max_sectors_kb In-reply-to: <20110218115603.5f235b07.akpm@linux-foundation.org> References: <20110217153719.9ecc67df.akpm@linux-foundation.org> <20110218174315.GD5615@twin.jikos.cz> <1298056463-sup-4453@think> <20110218115603.5f235b07.akpm@linux-foundation.org> Date: Fri, 18 Feb 2011 15:18:51 -0500 Message-Id: <1298059754-sup-2258@think> User-Agent: Sup/git X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4D5ED450.0074:SCFMA4539814,ss=1,fgs=0 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Feb 2011 20:21:52 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index d39a989..d8f7ee0 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -757,6 +757,10 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, tree_root->fs_info = fs_info; bdev = fs_devices->latest_bdev; + if (!bdev) { + printk(KERN_CRIT "btrfs read devices failed on %s\n", dev_name); + goto error_close_devices; + } s = sget(fs_type, btrfs_test_super, btrfs_set_super, tree_root); if (IS_ERR(s)) goto error_s;