From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cn.fujitsu.com ([59.151.112.132]:44346 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753815AbaF3C4e convert rfc822-to-8bit (ORCPT ); Sun, 29 Jun 2014 22:56:34 -0400 Message-ID: <53B0D220.3070608@cn.fujitsu.com> Date: Mon, 30 Jun 2014 10:57:36 +0800 From: Qu Wenruo MIME-Version: 1.0 To: =?UTF-8?B?U8OpYmFzdGllbiBST0hBVVQ=?= , Chris Murphy CC: Subject: Re: Can't mount subvolume with ro option References: <53ADCF0B.4010109@free.fr> <54D8214E-1C00-43AB-A68A-D450069D878C@colorremedies.com> <53AEA0D3.8080905@free.fr> <53B0C93E.8050500@cn.fujitsu.com> In-Reply-To: <53B0C93E.8050500@cn.fujitsu.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: -------- Original Message -------- Subject: Re: Can't mount subvolume with ro option From: Qu Wenruo To: Sébastien ROHAUT , Chris Murphy Date: 2014年06月30日 10:19 > > -------- Original Message -------- > Subject: Re: Can't mount subvolume with ro option > From: Sébastien ROHAUT > To: Chris Murphy > Date: 2014年06月28日 19:02 >> Le 28/06/2014 00:12, Chris Murphy a écrit : >>> On Jun 27, 2014, at 4:08 PM, Chris Murphy >>> wrote: >>> >>>> On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> In the wiki, it's said we can mount subvolumes with different >>>>> mount options. nosuid, nodev, rw and ro are listed, as valid >>>>> generic mount options. >>>> This might require 3.15. I don't recall it working with early 3.14 >>>> kernels, but by 3.14.3 I'd moved onto testing 3.15. >>> >>> [root@f20v ~]# mount /dev/sda3 /mnt >>> [root@f20v ~]# btrfs subvol create /mnt/test >>> Create subvolume '/mnt/test' >>> [root@f20v ~]# umount /mnt >>> [root@f20v ~]# mount -o ro,subvol=test /dev/sda3 /mnt >>> mount: /dev/sda3 is already mounted or /mnt busy >>> /dev/sda3 is already mounted on / >>> /dev/sda3 is already mounted on /home >>> /dev/sda3 is already mounted on /var >>> /dev/sda3 is already mounted on /boot >>> [root@f20v ~]# uname -r >>> 3.14.6-200.fc20.x86_64 >>> >>> >>> I don't know if this feature will be backported to stable kernels. >>> If not, then probably the wiki should say it's a 3.15+ feature. >>> Chris Murphy >>> >>> >> Thank you for your answer. I'm actually moving to a Fedora Rawhide >> (3.16 kernel). >> >> Sebastien Rohaut >> -- >> To unsubscribe from this list: send the line "unsubscribe >> linux-btrfs" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > When testing on 3.15.2-ARCH alone with 3.16-rc2, the problem can also > be reproduced. > > But I can't always reproduce it, sometimes I was able to mount subvol > with ro, > somtimes not. > > So I think the problem needs to be investigated further. > > Thanks, > Qu > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Finally find the stable method to reproduce the problem on 3.16-rc2, the point is if we mount subvol,ro first, then you can't mount the hole device: # mkfs.btrfs -f /dev/sda6 # mount /dev/sda6 /mnt/btrfs/ # btrfs sub create /mnt/btrfs/subv Create subvolume '/mnt/btrfs/subv' # umount /mnt/btrfs # mount -o subvol=subv,ro /dev/sda6 /mnt/other/ # LANG=C mount /dev/sda6 /mnt/btrfs/ mount: /dev/sda6 is already mounted or /mnt/btrfs busy /dev/sda6 is already mounted on /mnt/other Thanks, Qu