Re: [PATCH V2] btrfs: document mount options in Documentation/fs/btrfs.txt

2013-03-29 Thread David Sterba
Hi,

a few comments that reflect current implementation

On Tue, Mar 26, 2013 at 02:36:12PM -0500, Eric Sandeen wrote:
 +When mounting a btrfs filesystem, the following option are accepted.
 +Unless otherwise specified, all options default to off.
 +
 +  alloc_start=bytes
 + Debugging option to force all block allocations above a certain
 + byte threshold on each block device.  The value is specified in
 + bytes, optionally with a K, M, or G suffix, case insensitive.
 + Default is 1MB.

yes it is 1MB by default, and also a hardcoded minimum.

 +  max_inline=bytes
 + Specify the maximum amount of space, in bytes, that can be inlined in
 + a metadata B-tree leaf.  The value is specified in bytes, optionally 
 + with a K, M, or G suffix, case insensitive.  In practice, this value
 + is limited by the root sector size, with some space unavailable due

the 'root sector size' sounds a bit confusing, the commonly used term is
'sectorsize'

 + to leaf headers.  For a 4k sectorsize, max inline data is ~3900 bytes.
 +
 +  notreelog
 + Disable the tree logging used for fsync and O_SYNC writes.
 +
 + skip_balance
 + Skip automatic resume of interrupted balance operation after mount.
 + May be resumed with btrfs balance resume.

A dot inside a quotation looks confusing to non-us people, I hope nobody
will try to copypaste it :)

 +  subvolid=ID
 + Mount subvolume specified by an ID number rather than the root 
 subvolume.

 + This allows mounting of subvolumes which are not in the root of the 
 mounted
 + filesystem.

This sentence refers to the previous behaviour when subvol did not
accept full path. I suggest to drop it.

 + You can use btrfs subvolume list to see subvolume ID numbers.

Please add something in the sense of The toplevel subvolume has ID 0.

 +  subvolrootid=objectid (deprecated)
 + Mount subvolume specified by objectid rather than the root subvolume.
 + This allows mounting of subvolumes which are not in the root of the 
 mounted
 + filesystem.

Not true for a long time, since subvol=/full/path time it's a no-op. The
patch to print a warning when the option is used has been sent not so long
ago though.

 + You can use btrfs subvolume show  to see the object ID for a 
 subvolume.
 + 

It seems to me that you probably did not count
https://btrfs.wiki.kernel.org/index.php/Mount_options into the
documentation sources. We've tried to keep this page up-to-date, but it
does not cover the same things you did in this patch. Ideally merging
information from both is desirable.

thanks,
david
--
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


[PATCH V2] btrfs: document mount options in Documentation/fs/btrfs.txt

2013-03-26 Thread Eric Sandeen
Document all current btrfs mount options.

Signed-off-by: Eric Sandeen sand...@redhat.com
---

V2:
* reflect that btrfs is no longer new ;)
* make it clear that alloc_start is for each device
* highlight potential perf impacts of -o discard
* reword skip_balance docs to refer to resume


diff --git a/Documentation/filesystems/btrfs.txt 
b/Documentation/filesystems/btrfs.txt
index 7671352..b349d57 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -1,8 +1,8 @@
 
-   BTRFS
-   =
+BTRFS
+=
 
-Btrfs is a new copy on write filesystem for Linux aimed at
+Btrfs is a copy on write filesystem for Linux aimed at
 implementing advanced features while focusing on fault tolerance,
 repair and easy administration. Initially developed by Oracle, Btrfs
 is licensed under the GPL and open for contribution from anyone.
@@ -34,9 +34,175 @@ The main Btrfs features include:
 * Online filesystem defragmentation
 
 
+Mount Options
+=
 
-   MAILING LIST
-   
+When mounting a btrfs filesystem, the following option are accepted.
+Unless otherwise specified, all options default to off.
+
+  alloc_start=bytes
+   Debugging option to force all block allocations above a certain
+   byte threshold on each block device.  The value is specified in
+   bytes, optionally with a K, M, or G suffix, case insensitive.
+   Default is 1MB.
+
+  autodefrag
+   Detect small random writes into files and queue them up for the
+   defrag process.  Works best for small files; Not well suited for
+   large database workloads.
+
+  check_int
+  check_int_data
+  check_int_print_mask=value
+   These debugging options control the behavior of the integrity checking
+   module (the BTRFS_FS_CHECK_INTEGRITY config option required).
+
+   check_int enables the integrity checker module, which examines all
+   block write requests to ensure on-disk consistency, at a large
+   memory and CPU cost.  
+
+   check_int_data includes extent data in the integrity checks, and
+   implies the check_int option.
+
+   check_int_print_mask takes a bitmask of BTRFSIC_PRINT_MASK_* values
+   as defined in fs/btrfs/check-integrity.c, to control the integrity
+   checker module behavior.
+
+   See comments at the top of fs/btrfs/check-integrity.c for more info.
+
+  compress
+  compress=type
+  compress-force
+  compress-force=type
+   Control BTRFS file data compression.  Type may be specified as zlib
+   lzo or no (for no compression, used for remounting).  If no type
+   is specified, zlib is used.  If compress-force is specified,
+   all files will be compressed, whether or not they compress well.
+   If compression is enabled, nodatacow and nodatasum are disabled.
+
+  degraded
+   Allow mounts to continue with missing devices.  A read-write mount may
+   fail with too many devices missing, for example if a stripe member
+   is completely missing.
+
+  device=devicepath
+   Specify a device during mount so that ioctls on the control device
+   can be avoided.  Especialy useful when trying to mount a multi-device
+   setup as root.  May be specified multiple times for multiple devices.
+
+  discard
+   Issue frequent commands to let the block device reclaim space freed by
+   the filesystem.  This is useful for SSD devices, thinly provisioned
+   LUNs and virtual machine images, but may have a significant
+   performance impact.  (The fstrim command is also available to
+   initiate batch trims from userspace).
+
+  enospc_debug
+   Debugging option to be more verbose in some ENOSPC conditions.
+
+  fatal_errors=action
+   Action to take when encountering a fatal error: 
+ bug - BUG() on a fatal error.  This is the default.
+ panic - panic() on a fatal error.
+
+  flushoncommit
+   The 'flushoncommit' mount option forces any data dirtied by a write in a
+   prior transaction to commit as part of the current commit.  This makes
+   the committed state a fully consistent view of the file system from the
+   application's perspective (i.e., it includes all completed file system
+   operations).  This was previously the behavior only when a snapshot is
+   created.
+
+  inode_cache
+   Enable free inode number caching.   Defaults to off due to an overflow
+   problem when the free space crcs don't fit inside a single page.
+
+  max_inline=bytes
+   Specify the maximum amount of space, in bytes, that can be inlined in
+   a metadata B-tree leaf.  The value is specified in bytes, optionally 
+   with a K, M, or G suffix, case insensitive.  In practice, this value
+   is limited by the root sector size, with some space unavailable due
+   to leaf headers.  For a 4k sectorsize, max inline data is ~3900 bytes.
+
+  metadata_ratio=value
+   Specify that 1 metadata chunk should