linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore.
@ 2014-04-15  7:04 Qu Wenruo
  2014-04-15  7:04 ` [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Qu Wenruo @ 2014-04-15  7:04 UTC (permalink / raw)
  To: linux-btrfs

Convert man page for btrfs-restore, which I forgot to convert in the
previous patchset. :P

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 Documentation/Makefile          |  1 +
 Documentation/btrfs-restore.txt | 72 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 Documentation/btrfs-restore.txt

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 97a775a..dfacb93 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -30,6 +30,7 @@ MAN8_TXT += btrfs-quota.txt
 MAN8_TXT += btrfs-qgroup.txt
 MAN8_TXT += btrfs-replace.txt
 MAN8_TXT += btrfs-dedup.txt
+MAN8_TXT += btrfs-restore.txt
 
 MAN_TXT = $(MAN8_TXT)
 MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
diff --git a/Documentation/btrfs-restore.txt b/Documentation/btrfs-restore.txt
new file mode 100644
index 0000000..ea18ebb
--- /dev/null
+++ b/Documentation/btrfs-restore.txt
@@ -0,0 +1,72 @@
+btrfs-restore(8)
+================
+
+NAME
+----
+btrfs-restore - try to restore files from a damaged btrfs filesystem(unmounted)
+
+SYNOPSIS
+--------
+'btrfs restore' [options] <device> <path> | -l <device>
+
+DESCRIPTION
+-----------
+'btrfs restore' is used to try to salvage files from a damaged filesystem and
+restore them into <path> or just list the tree roots.
+
+Since current `btrfsck`(8) or `btrfs-rescue`(8) only has very limited usage,
+'btrfs restore' is normally a better choice.
+
+OPTIONS
+-------
+-s::
+get snapshots.
+
+-x::
+get extended attributes.
+
+-v::
+verbose.
+
+-i::
+ignore errors.
+
+-o::
+overwrite directories/files in <path>.
+
+-t <location>::
+use <location> to read root tree.
+
+-f <offset>::
+use <offset> to read fs tree.
+
+-u <block>::
+use given superblock mirror identified by <block>.
+
+-r <rootid>::
+use <rootid> as root objectid.
+
+-d::
+find dir.
+
+-l::
+list tree roots.
+
+EXIT STATUS
+-----------
+'btrfs restore' returns a zero exist status if it succeeds. Non zero is
+returned in case of failure.
+
+AVAILABILITY
+------------
+'btrfs' is part of btrfs-progs. Btrfs filesystem is currently under heavy
+development,
+and not suitable for any uses other than benchmarking and review.
+Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
+further details.
+
+SEE ALSO
+--------
+`mkfs.btrfs`(8),
+`btrfs-rescue`(8),
+`btrfs-check`(8)
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property.
  2014-04-15  7:04 [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore Qu Wenruo
@ 2014-04-15  7:04 ` Qu Wenruo
  2014-04-15  7:04 ` [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages Qu Wenruo
  2014-04-15  7:04 ` [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file Qu Wenruo
  2 siblings, 0 replies; 7+ messages in thread
From: Qu Wenruo @ 2014-04-15  7:04 UTC (permalink / raw)
  To: linux-btrfs

Convert the man page for the newly added btrfs-property subcommand.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 Documentation/Makefile           |  1 +
 Documentation/btrfs-property.txt | 69 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 Documentation/btrfs-property.txt

diff --git a/Documentation/Makefile b/Documentation/Makefile
index dfacb93..241b41d 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -31,6 +31,7 @@ MAN8_TXT += btrfs-qgroup.txt
 MAN8_TXT += btrfs-replace.txt
 MAN8_TXT += btrfs-dedup.txt
 MAN8_TXT += btrfs-restore.txt
+MAN8_TXT += btrfs-property.txt
 
 MAN_TXT = $(MAN8_TXT)
 MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
diff --git a/Documentation/btrfs-property.txt b/Documentation/btrfs-property.txt
new file mode 100644
index 0000000..82466f9
--- /dev/null
+++ b/Documentation/btrfs-property.txt
@@ -0,0 +1,69 @@
+btrfs-property(8)
+=================
+
+NAME
+----
+btrfs-property - get/set/list properties for given btrfs object.
+
+SYNOPSIS
+--------
+'btrfs property' <subcommand> <args>
+
+DESCRIPTION
+-----------
+'btrfs property' is used to get/set/list property, like lable or compression
+state, for given btrfs object.
+
+'btrfs property' provides an unified and user-friendly method to tune different
+btrfs properties instead of using the traditional method like `chattr`(1) or
+`lsattr`(1).
+
+SUBCOMMAND
+----------
+'get' [-t <type>] <object> [<name>]::
+Gets a property from a btrfs object.
++
+If no name is specified, all properties for the given object are
+printed.
+A filesystem object can be a the filesystem itself, a subvolume,
+an inode or a device.
++
+The '-t <type>' option can be used to explicitly
+specify what type of object you meant. This is only needed when a
+property could be set for more then one object type.
++
+Possible types are 's[ubvol]', 'f[ilesystem]', 'i[node]' and 'd[evice]'.
++
+The <object> can be path of btrfs device, btrfs mount point, or any
+directories/files inside btrfs.
+
+'set' [-t <type>] <object> <name> <value>::
+Sets a property on a btrfs object.
++
+See description of 'get' subcommand for a description of objects and object
+types.
+
+'list' [-t <type>] <object>::
+Lists available properties with their descriptions for the given object.
++
+Please see the help of 'btrfs property get' for a description of
+objects and object types.
+
+EXIT STATUS
+-----------
+'btrfs property' returns a zero exist status if it succeeds. Non zero is
+returned in case of failure.
+
+AVAILABILITY
+------------
+'btrfs' is part of btrfs-progs. Btrfs filesystem is currently under heavy
+development,
+and not suitable for any uses other than benchmarking and review.
+Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
+further details.
+
+SEE ALSO
+--------
+`mkfs.btrfs`(8),
+`lsattr`(1),
+`setattr`(8)
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages.
  2014-04-15  7:04 [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore Qu Wenruo
  2014-04-15  7:04 ` [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property Qu Wenruo
@ 2014-04-15  7:04 ` Qu Wenruo
  2014-04-15 16:55   ` David Sterba
  2014-04-15  7:04 ` [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file Qu Wenruo
  2 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2014-04-15  7:04 UTC (permalink / raw)
  To: linux-btrfs

Add btrfs wiki page reference to btrfs-check/btrfsck, btrfs-restore and
btrfs-device as supplement.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 Documentation/btrfs-check.txt   |  5 +++++
 Documentation/btrfs-device.txt  | 10 ++++++++--
 Documentation/btrfs-restore.txt |  4 ++++
 Documentation/btrfsck.txt       |  4 ++--
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Documentation/btrfs-check.txt b/Documentation/btrfs-check.txt
index accbed4..ddd7fe7 100644
--- a/Documentation/btrfs-check.txt
+++ b/Documentation/btrfs-check.txt
@@ -13,6 +13,11 @@ DESCRIPTION
 -----------
 'btrfs check' is used to check or repair a btrfs filesystem offline.
 
+NOTE: Since btrfs is under heavy development especially the 'btrfs check'
+command, it is *highly* recommended to read the following btrfs wiki before
+executing 'btrfs check' with '--repair' option: +
+https://btrfs.wiki.kernel.org/index.php/Btrfsck
+
 OPTIONS
 -------
 -s|--support <superblock>::
diff --git a/Documentation/btrfs-device.txt b/Documentation/btrfs-device.txt
index 523ae4d..7a6bce5 100644
--- a/Documentation/btrfs-device.txt
+++ b/Documentation/btrfs-device.txt
@@ -24,16 +24,22 @@ online.
 
 Profile::
 Btrfs filesystem uses data/metadata profiles to manage allocation/duplication
-mechanism. Profiles like RAID level can be assigned to data and metadata separately.
+mechanism. +
+Profiles like RAID level can be assigned to data and metadata separately.
 +
 See `mkfs.btrfs`(8) for more details.
 
 RAID level::
-Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10.
+Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10. +
 RAID levels can be assigned at mkfs time or online.
 +
 See `mkfs.btrfs`(8) for mkfs time RAID level assign and `btrfs-balance`(8) for
 online RAID level assign.
++
+NOTE: Since btrfs is under heavy development especially the RAID5/6 support,
+it is *highly* recommended to read the follow btrfs wiki page to get more
+updated details on RAID5/6: +
+https://btrfs.wiki.kernel.org/index.php/RAID56
 
 Balance::
 `btrfs-balance`(8) subcommand can be used to balance or rebuild chunks to the
diff --git a/Documentation/btrfs-restore.txt b/Documentation/btrfs-restore.txt
index ea18ebb..72aa084 100644
--- a/Documentation/btrfs-restore.txt
+++ b/Documentation/btrfs-restore.txt
@@ -17,6 +17,10 @@ restore them into <path> or just list the tree roots.
 Since current `btrfsck`(8) or `btrfs-rescue`(8) only has very limited usage,
 'btrfs restore' is normally a better choice.
 
+NOTE: It is recommended to read the following btrfs wiki page if your data is
+not salvaged with default option: +
+https://btrfs.wiki.kernel.org/index.php/Restore
+
 OPTIONS
 -------
 -s::
diff --git a/Documentation/btrfsck.txt b/Documentation/btrfsck.txt
index 751c4d0..defac80 100644
--- a/Documentation/btrfsck.txt
+++ b/Documentation/btrfsck.txt
@@ -20,8 +20,8 @@ Now, it can only be run on an unmounted FS.
 
 WARNING: Considering it is not well-tested in real-life situations yet.
 If you have a broken Btrfs filesystem, btrfsck may not repair but cause
-additional damages. 
-
+additional damages. See the wiki page for more: +
+https://btrfs.wiki.kernel.org/index.php/Btrfsck
 
 OPTIONS
 -------
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file.
  2014-04-15  7:04 [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore Qu Wenruo
  2014-04-15  7:04 ` [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property Qu Wenruo
  2014-04-15  7:04 ` [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages Qu Wenruo
@ 2014-04-15  7:04 ` Qu Wenruo
  2014-04-15  9:09   ` Filipe David Manana
  2 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2014-04-15  7:04 UTC (permalink / raw)
  To: linux-btrfs

When executing 'btrfs pro get' on a file which is not compressed, return
value will always be 50 since prop_compress() return -ENOATTR.

But this should be ignored and other prop_XXX() returns 0, so when
prop_compress() is executed on uncompress file, it should return 0.

Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com>
---
 props.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/props.c b/props.c
index 4d0aeea..49ee982 100644
--- a/props.c
+++ b/props.c
@@ -146,6 +146,7 @@ static int prop_compression(enum prop_object_type type,
 			fprintf(stderr,
 				"ERROR: failed to %s compression for %s. %s\n",
 				value ? "set" : "get", object, strerror(-ret));
+		ret = 0;
 		goto out;
 	}
 	if (!value) {
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file.
  2014-04-15  7:04 ` [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file Qu Wenruo
@ 2014-04-15  9:09   ` Filipe David Manana
  2014-04-15  9:15     ` Qu Wenruo
  0 siblings, 1 reply; 7+ messages in thread
From: Filipe David Manana @ 2014-04-15  9:09 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs@vger.kernel.org

On Tue, Apr 15, 2014 at 8:04 AM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
> When executing 'btrfs pro get' on a file which is not compressed, return
> value will always be 50 since prop_compress() return -ENOATTR.
>
> But this should be ignored and other prop_XXX() returns 0, so when
> prop_compress() is executed on uncompress file, it should return 0.
>
> Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com>
> ---
>  props.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/props.c b/props.c
> index 4d0aeea..49ee982 100644
> --- a/props.c
> +++ b/props.c
> @@ -146,6 +146,7 @@ static int prop_compression(enum prop_object_type type,
>                         fprintf(stderr,
>                                 "ERROR: failed to %s compression for %s. %s\n",
>                                 value ? "set" : "get", object, strerror(-ret));
> +               ret = 0;
>                 goto out;

Hi Qu,

So this should set ret to 0 if error ==  -ENOATTR. And of course the
check above should be against  -ENOATTR and not -ENODATA.

thanks


>         }
>         if (!value) {
> --
> 1.9.2
>
> --
> 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



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file.
  2014-04-15  9:09   ` Filipe David Manana
@ 2014-04-15  9:15     ` Qu Wenruo
  0 siblings, 0 replies; 7+ messages in thread
From: Qu Wenruo @ 2014-04-15  9:15 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs@vger.kernel.org


-------- Original Message --------
Subject: Re: [PATCH 4/4] btrfs-progs: Fix the return value when 
executing 'btrfs pro get' on a uncompress file.
From: Filipe David Manana <fdmanana@gmail.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2014年04月15日 17:09
> On Tue, Apr 15, 2014 at 8:04 AM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>> When executing 'btrfs pro get' on a file which is not compressed, return
>> value will always be 50 since prop_compress() return -ENOATTR.
>>
>> But this should be ignored and other prop_XXX() returns 0, so when
>> prop_compress() is executed on uncompress file, it should return 0.
>>
>> Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com>
>> ---
>>   props.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/props.c b/props.c
>> index 4d0aeea..49ee982 100644
>> --- a/props.c
>> +++ b/props.c
>> @@ -146,6 +146,7 @@ static int prop_compression(enum prop_object_type type,
>>                          fprintf(stderr,
>>                                  "ERROR: failed to %s compression for %s. %s\n",
>>                                  value ? "set" : "get", object, strerror(-ret));
>> +               ret = 0;
>>                  goto out;
> Hi Qu,
>
> So this should set ret to 0 if error ==  -ENOATTR. And of course the
> check above should be against  -ENOATTR and not -ENODATA.
>
> thanks
Thanks for pointing it out, I'll send the v2 patch soon.

Thanks,
Qu
>
>
>>          }
>>          if (!value) {
>> --
>> 1.9.2
>>
>> --
>> 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
>
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages.
  2014-04-15  7:04 ` [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages Qu Wenruo
@ 2014-04-15 16:55   ` David Sterba
  0 siblings, 0 replies; 7+ messages in thread
From: David Sterba @ 2014-04-15 16:55 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Tue, Apr 15, 2014 at 03:04:51PM +0800, Qu Wenruo wrote:
> Add btrfs wiki page reference to btrfs-check/btrfsck, btrfs-restore and
> btrfs-device as supplement.

I'd rather avoid any references to 'btrfsck', it's been deprecated and
'btrfs check' should be used, thouth I'm sure there are enough people
used to 'btrfsck' and this will take time before we can drop it
completely.

I'll add this patch as-is for now, but before the new documentation is
released, at least the deprecatio notice should be there.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-15 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15  7:04 [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore Qu Wenruo
2014-04-15  7:04 ` [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property Qu Wenruo
2014-04-15  7:04 ` [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages Qu Wenruo
2014-04-15 16:55   ` David Sterba
2014-04-15  7:04 ` [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file Qu Wenruo
2014-04-15  9:09   ` Filipe David Manana
2014-04-15  9:15     ` Qu Wenruo

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).