linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <liubo2009@cn.fujitsu.com>
To: Alexander Karbstein <alexander.karbstein@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs-progs: Enabled setting root subvolume with subvolid=0
Date: Tue, 31 Jul 2012 09:26:59 +0800	[thread overview]
Message-ID: <50173463.5060405@cn.fujitsu.com> (raw)
In-Reply-To: <1343696005-23703-1-git-send-email-alexander.karbstein@gmail.com>

On 07/31/2012 08:53 AM, Alexander Karbstein wrote:

> The command btrfs subvolume set-default 0 /path/to/fs changed the
> default subvolume to whatever subvolume was currently mounted on
> /path/to/fs. This patch changes this behaviour to set the default
> subvolume to BTRFS_FS_TREE_OBJECTID in case the user asks for
> subvolid=0
> 

> Signed-off-by: Alexander Karbstein <alexander.karbstein@gmail.com>
> ---
>  btrfs_cmds.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/btrfs_cmds.c b/btrfs_cmds.c
> index f2b6355..699d9b0 100644
> --- a/btrfs_cmds.c
> +++ b/btrfs_cmds.c
> @@ -964,6 +964,11 @@ int do_set_default_subvol(int nargs, char **argv)
>  		fprintf(stderr, "ERROR: invalid tree id (%s)\n",subvolid);
>  		return 30;
>  	}
> +	
> +	/* Using the original root fs tree */
> +	if (objectid == 0ULL) {
> +		objectid = BTRFS_FS_TREE_OBJECTID;
> +	}
>  	ret = ioctl(fd, BTRFS_IOC_DEFAULT_SUBVOL, &objectid);
>  	e = errno;
>  	close(fd);


Seems that you're using an old btrfs-prog source code, now the file is cmds-subvolume.c

And also checkpatch.pl complains about style errors while checking this.

thanks,
liubo

  reply	other threads:[~2012-07-31  1:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30  7:56 subvolumes: default and IDs Florian Lindner
2012-07-30 11:29 ` Calvin Walton
2012-07-30 12:43   ` Swâmi Petaramesh
2012-07-30 12:18 ` Liu Bo
2012-07-31  0:28 ` Alexander Karbstein
2012-07-31  0:50 ` Alexander Karbstein
2012-07-31  0:53   ` [PATCH] Btrfs-progs: Enabled setting root subvolume with subvolid=0 Alexander Karbstein
2012-07-31  1:26     ` Liu Bo [this message]
2012-07-31  2:09       ` Alexander Karbstein
2012-07-31 17:11       ` [PATCH V2] " Alexander Karbstein
2012-07-31 17:11       ` Alexander Karbstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50173463.5060405@cn.fujitsu.com \
    --to=liubo2009@cn.fujitsu.com \
    --cc=alexander.karbstein@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).