Skip to contentSkip to conversation

Btrgs-progs: Define _GNU_SOURCE for strndup

PATCH New Frederic Weisbecker 1 participant 2 messages Jun 28, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrgs-progs: Define _GNU_SOURCE for strndup

This fixes:

btrfs-list.c: Dans la fonction =C2=ABino_resolve=C2=BB :
btrfs-list.c:511: attention : d=C3=A9claration implicite de la fonction=
=C2=AB =C2=ABstrndup=C2=BB =C2=BB
btrfs-list.c:511: attention : incompatible implicit declaration of buil= t-in function =C2=ABstrndup=C2=BB
make: *** [btrfs-list.o] Erreur 1

and:

btrfs.c: Dans la fonction =C2=ABsplit_command=C2=BB :
btrfs.c:168: attention : d=C3=A9claration implicite de la fonction =C2=AB=
=C2=ABstrndup=C2=BB =C2=BB
btrfs.c:168: attention : incompatible implicit declaration of built-in = function =C2=ABstrndup=C2=BB
make: *** [btrfs.o] Erreur 1

---
 btrfs-list.c |    1 +
 btrfs.c      |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
btrfs-list.c +0 -0
index 7741705..9dedb5d 100644
@@ -16,6 +16,7 @@
  * Boston, MA 021110-1307, USA.
  */

=20
+#define _GNU_SOURCE
#ifndef __CHECKER__
#include <sys/ioctl.h>
#include <sys/mount.h>

btrfs.c +0 -0
index ab5e57f..672ffe2 100644
@@ -15,6 +15,7 @@
  */

=20
=20
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--=20
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

PATCH 1/1 Btrfs-progs: Handle bad extent type case

If we meet a bad extent type, find_updated_files is going to print random things. Better warn the user about what happens.

This fixes:

btrfs-list.c: Dans la fonction =C2=ABfind_updated_files=C2=BB :
btrfs-list.c:668: attention : =C2=ABdisk_offset=C2=BB may be used unini= tialized in this function
btrfs-list.c:668: note: =C2=ABdisk_offset=C2=BB was declared here btrfs-list.c:667: attention : =C2=ABdisk_start=C2=BB may be used uninit= ialized in this function
btrfs-list.c:667: note: =C2=ABdisk_start=C2=BB was declared here btrfs-list.c:666: attention : =C2=ABlen=C2=BB may be used uninitialized=
in this function
btrfs-list.c:666: note: =C2=ABlen=C2=BB was declared here
make: *** [btrfs-list.o] Erreur 1

---
 btrfs-list.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
btrfs-list.c +0 -0
index 9dedb5d..c90a1e6 100644
@@ -698,6 +698,15 @@ static int print_one_extent(int fd, struct btrfs_i=

octl_search_header *sh,
disk_start =3D 0;
disk_offset =3D 0;
len =3D btrfs_stack_file_extent_ram_bytes(item);
+ } else {
+ printf("unhandled extent type %d for inode %llu "
+ "file offset %llu gen %llu\n",
+ type,
+ (unsigned long long)sh->objectid,
+ (unsigned long long)sh->offset,
+ (unsigned long long)found_gen);
+
+ return -EIO;
}
printf("inode %llu file offset %llu len %llu disk start %llu "
"offset %llu gen %llu flags ",
--=20
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html