From patchwork Wed Jun 2 03:41:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 103691 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 o523g4T3022163 for ; Wed, 2 Jun 2010 03:42:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755747Ab0FBDlz (ORCPT ); Tue, 1 Jun 2010 23:41:55 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44239 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755447Ab0FBDly (ORCPT ); Tue, 1 Jun 2010 23:41:54 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 81D558ACEB; Wed, 2 Jun 2010 05:41:53 +0200 (CEST) Date: Wed, 2 Jun 2010 13:41:45 +1000 From: Neil Brown To: linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, jeffm@suse.com Subject: NFS exporting btrfs subvolumes. Message-ID: <20100602134145.0d523a75@notabene.brown> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.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.3 (demeter.kernel.org [140.211.167.41]); Wed, 02 Jun 2010 03:42:05 +0000 (UTC) diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index caef5b2..ffc5ac7 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -176,7 +176,8 @@ static const char *get_uuid_blkdev(char *path) blkid_tag_iterate iter; blkid_dev dev; const char *type; - const char *val = NULL; + const char *val; + const char *uuid_val = NULL; if (cache == NULL) blkid_get_cache(&cache, NULL); @@ -193,11 +194,16 @@ static const char *get_uuid_blkdev(char *path) iter = blkid_tag_iterate_begin(dev); if (!iter) return NULL; - while (blkid_tag_next(iter, &type, &val) == 0) + while (blkid_tag_next(iter, &type, &val) == 0) { if (strcmp(type, "UUID") == 0) + uuid_val = val; + if (strcmp(type, "TYPE") == 0 && + strcmp(val, "btrfs") == 0) { + uuid_val = NULL; break; + } blkid_tag_iterate_end(iter); - return val; + return uuid_val; } #else #define get_uuid_blkdev(path) (NULL)