Util-Linux package development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Karel Zak <kzak@redhat.com>
Cc: "Stanislav Brabec" <sbrabec@suse.cz>,
	util-linux <util-linux@vger.kernel.org>,
	"Søren Holm" <sgh@sgh.dk>
Subject: Re: [PATCH] fix mount -a on btrfs bind mount
Date: Fri, 4 Dec 2015 15:32:04 +0100	[thread overview]
Message-ID: <20151204143204.GA27926@suse.cz> (raw)
In-Reply-To: <20151202125117.GJ4955@ws.net.home>

On Wed, Dec 02, 2015 at 01:51:17PM +0100, Karel Zak wrote:
> On Fri, Nov 27, 2015 at 06:15:41PM +0100, Stanislav Brabec wrote:
> > root has to be literally the same as src_root, which is already the path
> > prefixed by /{subvolume}. Otherwise it will not match in
> > mnt_fs_streq_target(fs, xtgt) inside mnt_table_is_fs_mounted() and
> > repeated "mount -a" will mount it again and again.
> 
> yes
> 
> >  		if (src_root && !startswith(root, src_root)) {
> > -			size_t sz = strlen(root) + strlen(src_root) + 1;
> > -			char *tmp = malloc(sz);
> > -
> > +			char *tmp = strdup (src_root);
> >  			if (!tmp)
> >  				goto err;
> > -			snprintf(tmp, sz, "%s%s", src_root, root);
> >  			free(root);
> >  			root = tmp;
> >  		}
> 
> but this code is there for another use case. The problem is when the
> fstab_fs source is *sub-directory* on btrfs subvolume (or another bind
> mount). For example imagine:
> 
>   /dev/sdc        /mnt/test       btrfs   subvol=/anydir

Only subvolumes are accepted as parameter for 'subvol=', otherwise bind
mount needs to be used.

  parent reply	other threads:[~2015-12-04 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 17:11 [PATCH?] fix mount -a on btrfs bind mount Stanislav Brabec
2015-11-27 17:15 ` [PATCH] " Stanislav Brabec
2015-12-02 12:51   ` Karel Zak
2015-12-02 16:26     ` Stanislav Brabec
2015-12-04 14:32     ` David Sterba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-11-26 17:00 [PATCH?] " Stanislav Brabec

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=20151204143204.GA27926@suse.cz \
    --to=dsterba@suse.cz \
    --cc=kzak@redhat.com \
    --cc=sbrabec@suse.cz \
    --cc=sgh@sgh.dk \
    --cc=util-linux@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