Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* corrupted btrfs after suspend2ram uncorrectable with scrub
@ 2011-11-01 18:38 Gustavo Sverzut Barbieri
  2011-11-01 21:57 ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo Sverzut Barbieri @ 2011-11-01 18:38 UTC (permalink / raw)
  To: linux-btrfs

Hello,

I'm using kernel 3.1.0 and I have both / and /home as btrfs. I used
suspend to ram quite often and never had a problem, but yesterday I've
suspended to get into a plane and when I resumed my /home was all
about input/output errors. Reboot did not help either.  My root (/)
did not suffer any problems.

Today I've upgraded btrfs-progs to latest GIT and tried scrub without success:

  # btrfs scrub start -B -d /home/
  scrub device /dev/sda6 (id 1) done
  	scrub started at Sun Dec 31 23:13:19 2000 and finished after 273 seconds
  	total bytes scrubbed: 548.90MB with 1 errors
  	error details: verify=1
  	corrected errors: 0, uncorrectable errors: 1, unverified errors: 0

  # dmesg after "cat /home/gustavo/file":
  btrfs no csum found for inode 2957021 start 0
  btrfs no csum found for inode 2957021 start 0
  btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
wanted 0 mirror 0
  btrfs no csum found for inode 2957021 start 0
  btrfs no csum found for inode 2957021 start 0
  btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
wanted 0 mirror 1

  # dmesg during scrub:
  btrfs: unable to fixup at 402384056320

  # grep btrfs /etc/fstab
  /dev/sda4  /	 btrfs noatime,noacl,compress,nodatacow,nobarrier,ssd	0 0
  /dev/sda6  /home btrfs
noatime,noacl,compress,ssd,comment=systemd.automount 0 0

I can still list directories and all, but no file contents can be
read. Not even those that I'm sure were not changed recently, like
~/.emacs or some read-only files.

Before the suspend I was writing some code under
/home/gustavo/Development, but just 2 files were written recently. Of
course something like ~/.xsession-errors or some browser cache may
have changed recently. But nothing big like a compile.

It is an Apple MacBook Pro with their SSD. badblocks (read-only) shows
no errors.

Is there any way to recover it?  :-S

-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 9225-2202
Contact: http://www.gustavobarbieri.com.br/contact

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

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-01 18:38 corrupted btrfs after suspend2ram uncorrectable with scrub Gustavo Sverzut Barbieri
@ 2011-11-01 21:57 ` Alexandre Oliva
  2011-11-01 23:20   ` Gustavo Sverzut Barbieri
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2011-11-01 21:57 UTC (permalink / raw)
  To: Gustavo Sverzut Barbieri; +Cc: linux-btrfs

Hi, Gustavo,

On Nov  1, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com> wrote:

>   btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
> wanted 0 mirror 0

> Is there any way to recover it?  :-S

Did you try mounting without data checksums?

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-01 21:57 ` Alexandre Oliva
@ 2011-11-01 23:20   ` Gustavo Sverzut Barbieri
  2011-11-08 17:08     ` Gustavo Sverzut Barbieri
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo Sverzut Barbieri @ 2011-11-01 23:20 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: linux-btrfs

On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.unicamp.b=
r> wrote:
> Hi, Gustavo,
>
> On Nov =A01, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com> wrot=
e:
>
>> =A0 btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
>> wanted 0 mirror 0
>
>> Is there any way to recover it? =A0:-S
>
> Did you try mounting without data checksums?

Just tried to mount with -o nodatasum, no luck. Is that enough?


--=20
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 9225-2202
Contact: http://www.gustavobarbieri.com.br/contact
--
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] 8+ messages in thread

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-01 23:20   ` Gustavo Sverzut Barbieri
@ 2011-11-08 17:08     ` Gustavo Sverzut Barbieri
  2011-11-08 17:20       ` Chris Mason
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo Sverzut Barbieri @ 2011-11-08 17:08 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: linux-btrfs

On Tue, Nov 1, 2011 at 9:20 PM, Gustavo Sverzut Barbieri
<barbieri@gmail.com> wrote:
> On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.unicamp=
=2Ebr> wrote:
>> Hi, Gustavo,
>>
>> On Nov =A01, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com> wro=
te:
>>
>>> =A0 btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
>>> wanted 0 mirror 0
>>
>>> Is there any way to recover it? =A0:-S
>>
>> Did you try mounting without data checksums?
>
> Just tried to mount with -o nodatasum, no luck. Is that enough?

Ideas? Should I give up and consider data lost? :-(

--=20
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 9225-2202
Contact: http://www.gustavobarbieri.com.br/contact
--
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] 8+ messages in thread

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-08 17:08     ` Gustavo Sverzut Barbieri
@ 2011-11-08 17:20       ` Chris Mason
  2011-11-09 14:19         ` Gustavo Sverzut Barbieri
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Mason @ 2011-11-08 17:20 UTC (permalink / raw)
  To: Gustavo Sverzut Barbieri; +Cc: Alexandre Oliva, linux-btrfs

On Tue, Nov 08, 2011 at 03:08:41PM -0200, Gustavo Sverzut Barbieri wrot=
e:
> On Tue, Nov 1, 2011 at 9:20 PM, Gustavo Sverzut Barbieri
> <barbieri@gmail.com> wrote:
> > On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.unica=
mp.br> wrote:
> >> Hi, Gustavo,
> >>
> >> On Nov =A01, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com> w=
rote:
> >>
> >>> =A0 btrfs csum failed ino 2957021 extent 85041815552 csum 6673106=
79
> >>> wanted 0 mirror 0
> >>
> >>> Is there any way to recover it? =A0:-S
> >>
> >> Did you try mounting without data checksums?
> >
> > Just tried to mount with -o nodatasum, no luck. Is that enough?
>=20
> Ideas? Should I give up and consider data lost? :-(

We actually check the crcs even when mounted with nodatasum.  Can you
give the restore tool a shot from my current btrfs-progs git repo?  If
it can read it we can find a way to get the files off.

-chris

--
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] 8+ messages in thread

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-08 17:20       ` Chris Mason
@ 2011-11-09 14:19         ` Gustavo Sverzut Barbieri
  2011-11-09 14:27           ` Chris Mason
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo Sverzut Barbieri @ 2011-11-09 14:19 UTC (permalink / raw)
  To: Chris Mason, Gustavo Sverzut Barbieri, Alexandre Oliva,
	linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Tue, Nov 8, 2011 at 3:20 PM, Chris Mason <chris.mason@oracle.com> wrote:
> On Tue, Nov 08, 2011 at 03:08:41PM -0200, Gustavo Sverzut Barbieri wrote:
>> On Tue, Nov 1, 2011 at 9:20 PM, Gustavo Sverzut Barbieri
>> <barbieri@gmail.com> wrote:
>> > On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.unicamp.br> wrote:
>> >> Hi, Gustavo,
>> >>
>> >> On Nov  1, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com> wrote:
>> >>
>> >>>   btrfs csum failed ino 2957021 extent 85041815552 csum 667310679
>> >>> wanted 0 mirror 0
>> >>
>> >>> Is there any way to recover it?  :-S
>> >>
>> >> Did you try mounting without data checksums?
>> >
>> > Just tried to mount with -o nodatasum, no luck. Is that enough?
>>
>> Ideas? Should I give up and consider data lost? :-(
>
> We actually check the crcs even when mounted with nodatasum.  Can you
> give the restore tool a shot from my current btrfs-progs git repo?  If
> it can read it we can find a way to get the files off.

Hi Chris,

Fortunately it worked and I've restored, it misses symbolic links and
executable permissions (or I did a mistake somewhere, like mounting)
but overall it's all fine.

The attached patch was helpful to let me ignore stuff like development
files and caches. Speeds up the recovery :-)

Thanks!

-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 9225-2202
Contact: http://www.gustavobarbieri.com.br/contact

[-- Attachment #2: 0001-restore-allow-ignoring-file-name-patterns-and-paths.patch --]
[-- Type: text/x-patch, Size: 4805 bytes --]

From dc57b73b08fefb21099cc6b171683daaffa04501 Mon Sep 17 00:00:00 2001
From: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Date: Mon, 8 Jan 2001 00:37:39 -0200
Subject: [PATCH] restore: allow ignoring file name patterns and paths.

Introduce two new command line switches that can be specified multiple
times:

   -e path-pattern
   -E file-name-pattern

They are processed with fnmatch(), the first (-e) using FNM_PATHNAME
flag on the whole path string, the second uses no flag and is applied
only over the file or directory name.

Example:

   restore -v \
      -e '*/.cache' -e '*/.thumbnails' \
      -e '*/Desktop/Pictures' \
      -E '*~' \
      /dev/sdb1 /tmp/home-restore

will restore everything but files under ~/.cache, ~/.thumbnails and
~/Desktop/Pictures for every user (assume it's the mountpoint of
/home), also ignoring every backup file (*~).
---
 restore.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/restore.c b/restore.c
index 250c9d3..bdb0c7f 100644
--- a/restore.c
+++ b/restore.c
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <zlib.h>
+#include <fnmatch.h>
 #include "kerncompat.h"
 #include "ctree.h"
 #include "disk-io.h"
@@ -40,6 +41,9 @@ static int get_snaps = 0;
 static int verbose = 0;
 static int ignore_errors = 0;
 static int overwrite = 0;
+static char **exclude_paths = NULL;
+static char **exclude_patterns = NULL;
+static int dir_name_len = 0;
 
 static int decompress(char *inbuf, char *outbuf, u64 compress_len,
 		      u64 decompress_len)
@@ -436,6 +440,27 @@ set_size:
 	return 0;
 }
 
+static int is_excluded(const char *path, const char *name)
+{
+        char **itr;
+        if (exclude_paths) {
+                path += dir_name_len;
+                for (itr = exclude_paths; *itr != NULL; itr++) {
+                        if (fnmatch(*itr, path, FNM_PATHNAME) == 0) {
+                                return 1;
+                        }
+                }
+        }
+        if (exclude_patterns) {
+                for (itr = exclude_patterns; *itr != NULL; itr++) {
+                        if (fnmatch(*itr, path, 0) == 0) {
+                                return 1;
+                        }
+                }
+        }
+        return 0;
+}
+
 static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 		      const char *dir)
 {
@@ -568,6 +593,11 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 				}
 				ret = 0;
 			}
+                        if (is_excluded(path_name, filename)) {
+                                if (verbose)
+                                        printf("Ignored %s\n", path_name);
+                                goto next;
+                        }
 			if (verbose)
 				printf("Restoring %s\n", path_name);
 			fd = open(path_name, O_CREAT|O_WRONLY, 0644);
@@ -636,6 +666,11 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 				location.objectid = BTRFS_FIRST_FREE_OBJECTID;
 			}
 
+                        if (is_excluded(path_name, filename)) {
+                                if (verbose)
+                                        printf("Ignored %s\n", path_name);
+                                goto next;
+                        }
 			if (verbose)
 				printf("Restoring %s\n", path_name);
 
@@ -672,7 +707,7 @@ next:
 
 static void usage()
 {
-	fprintf(stderr, "Usage: restore [-svio] [-t disk offset] <device> "
+	fprintf(stderr, "Usage: restore [-svio] [-e exclude-paths] [-E exclude-name-patterns] [-t disk offset] <device> "
 		"<directory>\n");
 }
 
@@ -765,8 +800,15 @@ int main(int argc, char **argv)
 	int opt;
 	int super_mirror = 0;
 	int find_dir = 0;
+        int exclude_paths_idx = 0;
+        int exclude_patterns_idx = 0;
 
-	while ((opt = getopt(argc, argv, "sviot:u:df:")) != -1) {
+        if (argc > 1) {
+                exclude_paths = calloc(argc - 1, sizeof(char *));
+                exclude_patterns = calloc(argc - 1, sizeof(char *));
+        }
+
+	while ((opt = getopt(argc, argv, "sviot:u:df:e:E:")) != -1) {
 		switch (opt) {
 			case 's':
 				get_snaps = 1;
@@ -806,6 +848,14 @@ int main(int argc, char **argv)
 					exit(1);
 				}
 				break;
+			case 'e':
+				exclude_paths[exclude_paths_idx] = strdup(optarg);
+                                exclude_paths_idx++;
+				break;
+			case 'E':
+				exclude_patterns[exclude_patterns_idx] = strdup(optarg);
+                                exclude_patterns_idx++;
+				break;
 			case 'd':
 				find_dir = 1;
 				break;
@@ -855,6 +905,7 @@ int main(int argc, char **argv)
 			break;
 		dir_name[len - 1] = '\0';
 	}
+        dir_name_len = strlen(dir_name);
 
 	if (find_dir) {
 		ret = find_first_dir(root, &key.objectid);
-- 
1.7.7.1


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

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-09 14:19         ` Gustavo Sverzut Barbieri
@ 2011-11-09 14:27           ` Chris Mason
  2011-11-09 14:29             ` Gustavo Sverzut Barbieri
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Mason @ 2011-11-09 14:27 UTC (permalink / raw)
  To: Gustavo Sverzut Barbieri; +Cc: Alexandre Oliva, linux-btrfs

On Wed, Nov 09, 2011 at 12:19:58PM -0200, Gustavo Sverzut Barbieri wrot=
e:
> On Tue, Nov 8, 2011 at 3:20 PM, Chris Mason <chris.mason@oracle.com> =
wrote:
> > On Tue, Nov 08, 2011 at 03:08:41PM -0200, Gustavo Sverzut Barbieri =
wrote:
> >> On Tue, Nov 1, 2011 at 9:20 PM, Gustavo Sverzut Barbieri
> >> <barbieri@gmail.com> wrote:
> >> > On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.un=
icamp.br> wrote:
> >> >> Hi, Gustavo,
> >> >>
> >> >> On Nov =A01, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.com=
> wrote:
> >> >>
> >> >>> =A0 btrfs csum failed ino 2957021 extent 85041815552 csum 6673=
10679
> >> >>> wanted 0 mirror 0
> >> >>
> >> >>> Is there any way to recover it? =A0:-S
> >> >>
> >> >> Did you try mounting without data checksums?
> >> >
> >> > Just tried to mount with -o nodatasum, no luck. Is that enough?
> >>
> >> Ideas? Should I give up and consider data lost? :-(
> >
> > We actually check the crcs even when mounted with nodatasum. =A0Can=
 you
> > give the restore tool a shot from my current btrfs-progs git repo? =
=A0If
> > it can read it we can find a way to get the files off.
>=20
> Hi Chris,
>=20
> Fortunately it worked and I've restored, it misses symbolic links and
> executable permissions (or I did a mistake somewhere, like mounting)
> but overall it's all fine.

Great to hear you've pulled the files.  Do you need the kernel patch fo=
r
symlinks etc?

>=20
> The attached patch was helpful to let me ignore stuff like developmen=
t
> files and caches. Speeds up the recovery :-)

Very nice, thanks.

-chris

>=20
> Thanks!
>=20
> --=20
> Gustavo Sverzut Barbieri
> --------------------------------------
> Mobile: +55 (19) 9225-2202
> Contact: http://www.gustavobarbieri.com.br/contact

> From dc57b73b08fefb21099cc6b171683daaffa04501 Mon Sep 17 00:00:00 200=
1
> From: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
> Date: Mon, 8 Jan 2001 00:37:39 -0200
> Subject: [PATCH] restore: allow ignoring file name patterns and paths=
=2E
>=20
> Introduce two new command line switches that can be specified multipl=
e
> times:
>=20
>    -e path-pattern
>    -E file-name-pattern
>=20
> They are processed with fnmatch(), the first (-e) using FNM_PATHNAME
> flag on the whole path string, the second uses no flag and is applied
> only over the file or directory name.
>=20
> Example:
>=20
>    restore -v \
>       -e '*/.cache' -e '*/.thumbnails' \
>       -e '*/Desktop/Pictures' \
>       -E '*~' \
>       /dev/sdb1 /tmp/home-restore
>=20
> will restore everything but files under ~/.cache, ~/.thumbnails and
> ~/Desktop/Pictures for every user (assume it's the mountpoint of
> /home), also ignoring every backup file (*~).
> ---
>  restore.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++=
++--
>  1 files changed, 53 insertions(+), 2 deletions(-)
>=20
> diff --git a/restore.c b/restore.c
> index 250c9d3..bdb0c7f 100644
> --- a/restore.c
> +++ b/restore.c
> @@ -25,6 +25,7 @@
>  #include <fcntl.h>
>  #include <sys/stat.h>
>  #include <zlib.h>
> +#include <fnmatch.h>
>  #include "kerncompat.h"
>  #include "ctree.h"
>  #include "disk-io.h"
> @@ -40,6 +41,9 @@ static int get_snaps =3D 0;
>  static int verbose =3D 0;
>  static int ignore_errors =3D 0;
>  static int overwrite =3D 0;
> +static char **exclude_paths =3D NULL;
> +static char **exclude_patterns =3D NULL;
> +static int dir_name_len =3D 0;
> =20
>  static int decompress(char *inbuf, char *outbuf, u64 compress_len,
>  		      u64 decompress_len)
> @@ -436,6 +440,27 @@ set_size:
>  	return 0;
>  }
> =20
> +static int is_excluded(const char *path, const char *name)
> +{
> +        char **itr;
> +        if (exclude_paths) {
> +                path +=3D dir_name_len;
> +                for (itr =3D exclude_paths; *itr !=3D NULL; itr++) {
> +                        if (fnmatch(*itr, path, FNM_PATHNAME) =3D=3D=
 0) {
> +                                return 1;
> +                        }
> +                }
> +        }
> +        if (exclude_patterns) {
> +                for (itr =3D exclude_patterns; *itr !=3D NULL; itr++=
) {
> +                        if (fnmatch(*itr, path, 0) =3D=3D 0) {
> +                                return 1;
> +                        }
> +                }
> +        }
> +        return 0;
> +}
> +
>  static int search_dir(struct btrfs_root *root, struct btrfs_key *key=
,
>  		      const char *dir)
>  {
> @@ -568,6 +593,11 @@ static int search_dir(struct btrfs_root *root, s=
truct btrfs_key *key,
>  				}
>  				ret =3D 0;
>  			}
> +                        if (is_excluded(path_name, filename)) {
> +                                if (verbose)
> +                                        printf("Ignored %s\n", path_=
name);
> +                                goto next;
> +                        }
>  			if (verbose)
>  				printf("Restoring %s\n", path_name);
>  			fd =3D open(path_name, O_CREAT|O_WRONLY, 0644);
> @@ -636,6 +666,11 @@ static int search_dir(struct btrfs_root *root, s=
truct btrfs_key *key,
>  				location.objectid =3D BTRFS_FIRST_FREE_OBJECTID;
>  			}
> =20
> +                        if (is_excluded(path_name, filename)) {
> +                                if (verbose)
> +                                        printf("Ignored %s\n", path_=
name);
> +                                goto next;
> +                        }
>  			if (verbose)
>  				printf("Restoring %s\n", path_name);
> =20
> @@ -672,7 +707,7 @@ next:
> =20
>  static void usage()
>  {
> -	fprintf(stderr, "Usage: restore [-svio] [-t disk offset] <device> "
> +	fprintf(stderr, "Usage: restore [-svio] [-e exclude-paths] [-E excl=
ude-name-patterns] [-t disk offset] <device> "
>  		"<directory>\n");
>  }
> =20
> @@ -765,8 +800,15 @@ int main(int argc, char **argv)
>  	int opt;
>  	int super_mirror =3D 0;
>  	int find_dir =3D 0;
> +        int exclude_paths_idx =3D 0;
> +        int exclude_patterns_idx =3D 0;
> =20
> -	while ((opt =3D getopt(argc, argv, "sviot:u:df:")) !=3D -1) {
> +        if (argc > 1) {
> +                exclude_paths =3D calloc(argc - 1, sizeof(char *));
> +                exclude_patterns =3D calloc(argc - 1, sizeof(char *)=
);
> +        }
> +
> +	while ((opt =3D getopt(argc, argv, "sviot:u:df:e:E:")) !=3D -1) {
>  		switch (opt) {
>  			case 's':
>  				get_snaps =3D 1;
> @@ -806,6 +848,14 @@ int main(int argc, char **argv)
>  					exit(1);
>  				}
>  				break;
> +			case 'e':
> +				exclude_paths[exclude_paths_idx] =3D strdup(optarg);
> +                                exclude_paths_idx++;
> +				break;
> +			case 'E':
> +				exclude_patterns[exclude_patterns_idx] =3D strdup(optarg);
> +                                exclude_patterns_idx++;
> +				break;
>  			case 'd':
>  				find_dir =3D 1;
>  				break;
> @@ -855,6 +905,7 @@ int main(int argc, char **argv)
>  			break;
>  		dir_name[len - 1] =3D '\0';
>  	}
> +        dir_name_len =3D strlen(dir_name);
> =20
>  	if (find_dir) {
>  		ret =3D find_first_dir(root, &key.objectid);
> --=20
> 1.7.7.1
>=20

--
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] 8+ messages in thread

* Re: corrupted btrfs after suspend2ram uncorrectable with scrub
  2011-11-09 14:27           ` Chris Mason
@ 2011-11-09 14:29             ` Gustavo Sverzut Barbieri
  0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Sverzut Barbieri @ 2011-11-09 14:29 UTC (permalink / raw)
  To: Chris Mason, Gustavo Sverzut Barbieri, Alexandre Oliva,
	linux-btrfs

On Wed, Nov 9, 2011 at 12:27 PM, Chris Mason <chris.mason@oracle.com> w=
rote:
> On Wed, Nov 09, 2011 at 12:19:58PM -0200, Gustavo Sverzut Barbieri wr=
ote:
>> On Tue, Nov 8, 2011 at 3:20 PM, Chris Mason <chris.mason@oracle.com>=
 wrote:
>> > On Tue, Nov 08, 2011 at 03:08:41PM -0200, Gustavo Sverzut Barbieri=
 wrote:
>> >> On Tue, Nov 1, 2011 at 9:20 PM, Gustavo Sverzut Barbieri
>> >> <barbieri@gmail.com> wrote:
>> >> > On Tue, Nov 1, 2011 at 7:57 PM, Alexandre Oliva <oliva@lsd.ic.u=
nicamp.br> wrote:
>> >> >> Hi, Gustavo,
>> >> >>
>> >> >> On Nov =A01, 2011, Gustavo Sverzut Barbieri <barbieri@gmail.co=
m> wrote:
>> >> >>
>> >> >>> =A0 btrfs csum failed ino 2957021 extent 85041815552 csum 667=
310679
>> >> >>> wanted 0 mirror 0
>> >> >>
>> >> >>> Is there any way to recover it? =A0:-S
>> >> >>
>> >> >> Did you try mounting without data checksums?
>> >> >
>> >> > Just tried to mount with -o nodatasum, no luck. Is that enough?
>> >>
>> >> Ideas? Should I give up and consider data lost? :-(
>> >
>> > We actually check the crcs even when mounted with nodatasum. =A0Ca=
n you
>> > give the restore tool a shot from my current btrfs-progs git repo?=
 =A0If
>> > it can read it we can find a way to get the files off.
>>
>> Hi Chris,
>>
>> Fortunately it worked and I've restored, it misses symbolic links an=
d
>> executable permissions (or I did a mistake somewhere, like mounting)
>> but overall it's all fine.
>
> Great to hear you've pulled the files. =A0Do you need the kernel patc=
h for
> symlinks etc?

Nah, they were a couple of links from svn/git repos to ~/bin and
similar, I restored them already.


>> The attached patch was helpful to let me ignore stuff like developme=
nt
>> files and caches. Speeds up the recovery :-)
>
> Very nice, thanks.

Hope you can apply it :-)


--=20
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 9225-2202
Contact: http://www.gustavobarbieri.com.br/contact
--
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] 8+ messages in thread

end of thread, other threads:[~2011-11-09 14:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 18:38 corrupted btrfs after suspend2ram uncorrectable with scrub Gustavo Sverzut Barbieri
2011-11-01 21:57 ` Alexandre Oliva
2011-11-01 23:20   ` Gustavo Sverzut Barbieri
2011-11-08 17:08     ` Gustavo Sverzut Barbieri
2011-11-08 17:20       ` Chris Mason
2011-11-09 14:19         ` Gustavo Sverzut Barbieri
2011-11-09 14:27           ` Chris Mason
2011-11-09 14:29             ` Gustavo Sverzut Barbieri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox