From patchwork Thu Feb 25 20:38:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 82158 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1PKcwEc028191 for ; Thu, 25 Feb 2010 20:38:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933640Ab0BYUii (ORCPT ); Thu, 25 Feb 2010 15:38:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12921 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933362Ab0BYUih (ORCPT ); Thu, 25 Feb 2010 15:38:37 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1PKcZWL005725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Feb 2010 15:38:36 -0500 Received: from localhost.localdomain (vpn-10-212.rdu.redhat.com [10.11.10.212]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1PKcZBk007787; Thu, 25 Feb 2010 15:38:35 -0500 Date: Thu, 25 Feb 2010 15:38:35 -0500 From: Josef Bacik To: Andrew Lutomirski Cc: Josef Bacik , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [2.6.33 regression] btrfs mount causes memory corruption Message-ID: <20100225203834.GD10960@localhost.localdomain> References: <20100225202358.GC10960@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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 (demeter.kernel.org [140.211.167.41]); Thu, 25 Feb 2010 20:38:58 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8a1ea6e..f8b4521 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -128,7 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) { struct btrfs_fs_info *info = root->fs_info; substring_t args[MAX_OPT_ARGS]; - char *p, *num; + char *p, *num, *orig; int intarg; int ret = 0; @@ -143,6 +143,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) if (!options) return -ENOMEM; + orig = options; while ((p = strsep(&options, ",")) != NULL) { int token; @@ -280,7 +281,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) } } out: - kfree(options); + kfree(orig); return ret; }