Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay
Chandan Rajendra wrote on 2015/12/08 15:36 +0530: On Tuesday 08 Dec 2015 14:10:33 Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags at remount time, so add a new parameter for parse_options(). Signed-off-by: Qu Wenruo--- v2: Make RO check mandatory for btrfs_parse_options(). Add btrfs_show_options() support for nologreplay. Document for btrfs-mount(5) will follow after the patch being merged. --- Documentation/filesystems/btrfs.txt | 7 +++ fs/btrfs/ctree.h| 4 +++- fs/btrfs/disk-io.c | 7 --- fs/btrfs/super.c| 29 + 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index c772b47..7ad5b93 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt @@ -168,6 +168,13 @@ Options with (*) are default options and will not show in the mount options. notreelog Enable/disable the tree logging used for fsync and O_SYNC writes. + nologreplay + Disable the log tree replay at mount time to prevent devices get + modified. Must be use with 'ro' mount option. + A filesystem mounted with the 'nologreplay' option cannot + transition to a read-write mount via remount,rw - the filesystem + must be unmounted and remounted if read-write access is desired. + May be the following is slightly better ... Disable the log tree replay at mount time to prevent filesystem from getting modified. Must be used with 'ro' mount option. A filesystem mounted with the 'nologreplay' option cannot transition to a read-write mount via remount,rw - the filesystem must be unmounted and mounted back again if read-write access is desired. Thanks for the review and advice. Since I'm not a native English speaker, I'll follow your advice. (Yeah, remount in my patch is confusing.) I'll update it to v3 with Document update only Thank, Qu Aside from above, everything else looks good to me. Reviewed-by: Chandan Rajendra -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay
On Tuesday 08 Dec 2015 14:10:33 Qu Wenruo wrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. > > Since the new parse_options() need to check new flags at remount time, > so add a new parameter for parse_options(). > > Signed-off-by: Qu Wenruo> --- > v2: > Make RO check mandatory for btrfs_parse_options(). > Add btrfs_show_options() support for nologreplay. > > Document for btrfs-mount(5) will follow after the patch being merged. > --- > Documentation/filesystems/btrfs.txt | 7 +++ > fs/btrfs/ctree.h| 4 +++- > fs/btrfs/disk-io.c | 7 --- > fs/btrfs/super.c| 29 + > 4 files changed, 39 insertions(+), 8 deletions(-) > > diff --git a/Documentation/filesystems/btrfs.txt > b/Documentation/filesystems/btrfs.txt index c772b47..7ad5b93 100644 > --- a/Documentation/filesystems/btrfs.txt > +++ b/Documentation/filesystems/btrfs.txt > @@ -168,6 +168,13 @@ Options with (*) are default options and will not show > in the mount options. notreelog > Enable/disable the tree logging used for fsync and O_SYNC writes. > > + nologreplay > + Disable the log tree replay at mount time to prevent devices get > + modified. Must be use with 'ro' mount option. > + A filesystem mounted with the 'nologreplay' option cannot > + transition to a read-write mount via remount,rw - the filesystem > + must be unmounted and remounted if read-write access is desired. > + May be the following is slightly better ... Disable the log tree replay at mount time to prevent filesystem from getting modified. Must be used with 'ro' mount option. A filesystem mounted with the 'nologreplay' option cannot transition to a read-write mount via remount,rw - the filesystem must be unmounted and mounted back again if read-write access is desired. Aside from above, everything else looks good to me. Reviewed-by: Chandan Rajendra -- chandan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay
On 2015-12-08 01:10, Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags at remount time, so add a new parameter for parse_options(). Signed-off-by: Qu Wenruo--- v2: Make RO check mandatory for btrfs_parse_options(). Add btrfs_show_options() support for nologreplay. Document for btrfs-mount(5) will follow after the patch being merged. Same set of tests I ran against the last version, still no issues, so: Tested-by: Austin S. Hemmelgarn smime.p7s Description: S/MIME Cryptographic Signature
Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay
Roman Mamedov wrote on 2015/12/08 11:31 +0500: On Tue, 8 Dec 2015 14:10:33 +0800 Qu Wenruowrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Maybe name it "norecovery" too, for simplicity and consistency? That's also our first idea. But the sad fact is, btrfs already has a mount option called "recovery". So "norecovery" here will just be considered as a mount option to disable "recovery", and that will make things more confusing. And finally we choose the name "nologreplay". Thanks, Qu The actual effect of "norecovery" in ext* and xfs is to also disable log replay, but that's an under-the-hood detail not relevant to the user. --- Mount options for ext3 norecovery/noload Don't load the journal on mounting. Note that if the filesystem was not unmounted cleanly, skipping the journal replay will lead to the filesystem containing inconsistencies that can lead to any number of problems. --- Mount options for xfs norecovery The filesystem will be mounted without running log recovery. If the filesystem was not cleanly unmounted, it is likely to be inconsistent when mounted in norecovery mode. Some files or directories may not be accessible because of this. Filesystems mounted norecovery must be mounted read-only or the mount will fail. --- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay
On Tue, 8 Dec 2015 14:10:33 +0800 Qu Wenruowrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. Maybe name it "norecovery" too, for simplicity and consistency? The actual effect of "norecovery" in ext* and xfs is to also disable log replay, but that's an under-the-hood detail not relevant to the user. --- Mount options for ext3 norecovery/noload Don't load the journal on mounting. Note that if the filesystem was not unmounted cleanly, skipping the journal replay will lead to the filesystem containing inconsistencies that can lead to any number of problems. --- Mount options for xfs norecovery The filesystem will be mounted without running log recovery. If the filesystem was not cleanly unmounted, it is likely to be inconsistent when mounted in norecovery mode. Some files or directories may not be accessible because of this. Filesystems mounted norecovery must be mounted read-only or the mount will fail. --- -- With respect, Roman signature.asc Description: PGP signature