Commit Graph

519 Commits (d88f33152f3d69240b6c690188b5d832a1663c07)
 

Author SHA1 Message Date
Goffredo Baroncelli 0dbd99fb3e Scan the devices listed in /proc/partitions
During the commands:
	- btrfs filesystem show
	- btrfs device scan
the devices "scanned" are extracted from /proc/partitions. This
should avoid to scan devices not suitable for a btrfs filesystem like cdrom
and floppy or to scan not existant devices.
The old behavior (scan all the block devices under /dev) may be
forced passing the "--all-devices" switch.
2011-10-25 09:19:00 -04:00
Jeff Liu 521770b7a9 Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs buffer overflow
Hello,

While going through the mkfs.c, I noticed there is an issue for label
length checking, mkfs.btrfs will crashed if the label length exceeding
255 bytes, it's easy to triggered that out as below:

jeff@pibroch:~/opensource/btrfs-progs$ sudo ./mkfs.btrfs -L `perl -e
'print "A"x256'` /usr/src/linux-3.0/img0

WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

*** buffer overflow detected ***: ./mkfs.btrfs terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb7774df0]
/lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0xb7773cca]
/lib/i386-linux-gnu/libc.so.6(__strcpy_chk+0x3f)[0xb777305f]
./mkfs.btrfs[0x805acc4]
./mkfs.btrfs[0x805def6]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0xb76a5e37]
./mkfs.btrfs[0x8048ef1]
======= Memory map: ========
......

a tiny patch could fix it.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
2011-10-25 09:18:59 -04:00
Sergei Trofimovich 3d7c94cfec btrfsck: decode error properly
check_mounted() returns kernel-style negative errors.
Patch drops sign for strerror().

Before the patch:
check_mounted(): Could not open /dev/sdb2
Could not check mount status: Unknown error 18446744073709551603

After the patch:
check_mounted(): Could not open /dev/sdb2
Could not check mount status: Permission denied

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2011-10-25 09:18:59 -04:00
Andreas Philipp a8b624eae7 check number of args for btrfs sub snap correctly
Check whether there are the right number of arguments (exatly 2 without
the flag -r) in the subcommand handler for the btrfs subvolume snapshot
command.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
2011-10-25 09:18:59 -04:00
Zhong, Xin a70b0b2bba Btrfs-progs: add "btrfs subvolume get-default" subcommand
Add subcommand to get the default subvolume of btrfs filesystem

V2->V3:
* add man page
* based on http://git.darksatanic.net/repo/btrfs-progs-unstable.git
  integration-20110705

Reviewed-by: Andreas Philipp <philipp.andreas@gmail.com>
Reviewed-by: Goffredo Baroncelli <kreijack@libero.it>
Reported-by: Yang, Yi <yi.y.yang@intel.com>
Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
2011-10-25 09:18:59 -04:00
Wang Sheng-Hui fdbebea13b btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL
From c04da1655df6d75db834ddbd3a3b4a58a0d9a0c9 Mon Sep 17 00:00:00 2001
From: Wang Sheng-Hui <shhuiw@gmail.com>
Date: Mon, 18 Jul 2011 02:17:31 -0500
Subject: [PATCH] btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL

debug-tree doesn't exist after btrfs-progs installed.
Use btrfs-debug-tree to print FS metadata in text form,
not debug-tree.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
2011-10-25 09:18:59 -04:00
Hugo Mills ae62acb3c9 fix incorrect argument checking for "btrfs sub snap -r"
Stephane Chazelas and Andreas Philipp spotted that the earlier patch
fixing this issue was incomplete, and should also update the argument-
count checking code as well.

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Jan Schmidt 25439670a6 btrfs-progs: scrub added to manpage
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Jan Schmidt 4ba1653187 btrfs-progs: scrub userland implementation
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Jan Schmidt 828f2b30df btrfs-progs: added check_mounted_where
new version of check_mounted() returning more information gathered while
searching. check_mounted() is now a wrapper for check_mounted_where(). the
new version is needed by scrub.c

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Jan Schmidt eecfba1d34 btrfs-progs: scrub ioctls
- scrub structs added
- ioctls for scrub
- BTRFS_FSID_SIZE moved

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Jan Schmidt 19011f9ab6 btrfs-progs: commands added
- scrub commands added
- open_file_or_dir no longer static (needed by scrub.c)

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Andreas Philipp d8e974fb4c remove unused include "version.h"
In the file btrfs-list.c version.h was included but not used. So just
drop it.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Andreas Philipp be1c3b1fda update manpage entries for btrfs subvolume list
Update the manpage entries for the btrfs subvolume list command to
reflect the newly created additional option '-p'.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Andreas Philipp 97a3182fbf print parent ID in btrfs suvolume list
There was some discussion on "where" subvolumes live in. Why do we not
simply print the parent ID for each subvolume in btrfs subvolume list?
This patch adds this functionality when called with parameter "-p".

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Andreas Philipp fd635cdc2d some style/layout changes
Just do a few simple style/layout changes to make the makefile look
better.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Andreas Philipp 3aa511e7ed add all targets to clean target
When issuing 'make clean' not all files generated by the individual
targets have been deleted since some files have been missing in the
definition of the 'make clean' target.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Hubert Kario 3c3a13bf3f remove unused variables
fixes compilation warnings with gcc 4.6.0 20110429

Signed-off-by: Hubert Kario <kario@wit.edu.pl>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Hugo Mills db9831e4f4 gcc 4.6: fix potentially unused variable
Fix a complaint by gcc 4.6 that "ret" may be unused in
process_one_leaf of btrfsck.

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:59 -04:00
Kamble, Nitin A 3516e6b56e make btrfs cross compilation friendly
Attached is a patch to fix a cross compilation issue I observed with btrfs-tools.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>

Nitin A Kamble
Yocto Project
www.yoctoproject.org

Avoid these kinds of errors while doing cross build:

| ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build0/tmp/sysroots/qemux86 -Wp,-MMD,./.btrfsctl.o.d,-MT,btrfsctl.o -Wall -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -c btrfsctl.c
| gcc -O2 -pipe -g -feliminate-unused-debug-types -o btrfsctl btrfsctl.o ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o root-tree.o dir-item.o file-item.o inode-item.o inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o volumes.o utils.o btrfs-list.o -Wl,-O1  -Wl,--as-needed -luuid
| /usr/bin/ld: i386 architecture of input file `btrfsctl.o' is incompatible with i386:x86-64 output
| /usr/bin/ld: i386 architecture of input file `ctree.o' is incompatible with i386:x86-64 output
2011-10-25 09:18:58 -04:00
Hugo Mills acee5809c1 mkfs.btrfs: Fix compilation errors with gcc 4.6
gcc 4.6 complains about several possible use-before-initialise cases
in mkfs, and stops. Fix these by initialising one of the variables in
question, and using the correct error-handling paths for the
remainder.

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
cwillu 796a0e9cc4 Btrfs-progs: Correct path munging in bcp
Bcp was assuming that a path on the command line would never have a slash after
it, which is silly, and would cause the first letter of everything in the root
of the source to be truncated.  Instead, use os.path.relpath to handle
it properly.

Signed-off-by: Carey Underwood <cwillu@cwillu.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Arne Jansen 48d29930ed btrfs-map-logical: segfaults when no output file is given
when no output file is given, info_file stays NULL and the following
fprintf segfaults. Default to stdout.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich 925ac32518 mkfs.btrfs: fix error text in '-r' mode
Smart gcc noticed use of uninitialized warning when compiled
with -O0 flags:

    mkfs.c:1291: error: 'file' may be used uninitialized in this function

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich d69c30808c mkfs.btrfs: fix memory leak caused by 'scandir()' calls
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich e06947319c mkfs.btrfs: free buffers allocated by pretty_sizes
found by valgrind:
==2559== 16 bytes in 1 blocks are definitely lost in loss record 3 of 19
==2559==    at 0x4C2720E: malloc (vg_replace_malloc.c:236)
==2559==    by 0x412F7E: pretty_sizes (utils.c:1054)
==2559==    by 0x4179E9: main (mkfs.c:1395)

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich 8e4b7e883a mkfs.btrfs: write zeroes instead on uninitialized data.
Found by valgrind:
==8968== Use of uninitialised value of size 8
==8968==    at 0x41CE7D: crc32c_le (crc32c.c:98)
==8968==    by 0x40A1D0: csum_tree_block_size (disk-io.c:82)
==8968==    by 0x40A2D4: csum_tree_block (disk-io.c:105)
==8968==    by 0x40A7D6: write_tree_block (disk-io.c:241)
==8968==    by 0x40ACEE: __commit_transaction (disk-io.c:354)
==8968==    by 0x40AE9E: btrfs_commit_transaction (disk-io.c:385)
==8968==    by 0x42CF66: make_image (mkfs.c:1061)
==8968==    by 0x42DE63: main (mkfs.c:1410)
==8968==  Uninitialised value was created by a stack allocation
==8968==    at 0x42B5FB: add_inode_items (mkfs.c:493)

1. On-disk inode format has reserved (and thus, random at alloc time) fields:
   btrfs_inode_item: __le64 reserved[4]
2. Sometimes extents are created on disk without writing data there.
   (Or at least not all data is written there). Kernel code always had
   it kzalloc'ed.
Zero them all.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich f509f1762e mkfs.btrfs: fix symlink names writing
Found by valgrind:
==8968== Use of uninitialised value of size 8
==8968==    at 0x41CE7D: crc32c_le (crc32c.c:98)
==8968==    by 0x40A1D0: csum_tree_block_size (disk-io.c:82)
==8968==    by 0x40A2D4: csum_tree_block (disk-io.c:105)
==8968==    by 0x40A7D6: write_tree_block (disk-io.c:241)
==8968==    by 0x40ACEE: __commit_transaction (disk-io.c:354)
==8968==    by 0x40AE9E: btrfs_commit_transaction (disk-io.c:385)
==8968==    by 0x42CF66: make_image (mkfs.c:1061)
==8968==    by 0x42DE63: main (mkfs.c:1410)
==8968==  Uninitialised value was created by a stack allocation
==8968==    at 0x42B5FB: add_inode_items (mkfs.c:493)

readlink(2) does not write '\0' for us, so make it manually.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich 891dea4f00 mkfs.btrfs: return some defined value instead of garbage when lookup checksum
==31873== Command: ./mkfs.btrfs -r /some/root/
==31873== Parent PID: 31872
==31873==
==31873== Conditional jump or move depends on uninitialised value(s)
==31873==    at 0x42C3D0: add_file_items (mkfs.c:792)
==31873==    by 0x42CAB3: traverse_directory (mkfs.c:948)
==31873==    by 0x42CF11: make_image (mkfs.c:1047)
==31873==    by 0x42DE53: main (mkfs.c:1401)
==31873==  Uninitialised value was created by a stack allocation
==31873==    at 0x41B1B1: btrfs_csum_file_block (file-item.c:195)

'ret' value was not initialized for 'found' branch.

The same fix sits in kernel:
> commit 639cb58675ce9b507eed9c3d6b3335488079b21a
> Author: Chris Mason <chris.mason@oracle.com>
> Date:   Thu Aug 28 06:15:25 2008 -0400
>
>     Btrfs: Fix variable init during csum creation
>
>     Signed-off-by: Chris Mason <chris.mason@oracle.com>

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich 545b52c2fa mkfs.btrfs: fail on scandir error (-r mode)
mkfs.btrfs does not handle relative pathnames for now. When
they are passed to it it creates empty image. So first time
I thought it does not work at all.

This patch adds error handling for scandir(). With patch it behaves
this way:

    $ mkfs.btrfs -r ./root
    ...
    fs created label (null) on output.img
            nodesize 4096 leafsize 4096 sectorsize 4096 size 256.00MB
    Btrfs v0.19-52-g438c5ff-dirty
    scandir for ./root failed: No such file or directory
    unable to traverse_directory
    Making image is aborted.
    mkfs.btrfs: mkfs.c:1402: main: Assertion `!(ret)' failed.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Sergei Trofimovich 2acb6817c7 btrfs-convert: fix typo: 'all inode' -> 'all inodes'
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Fajar A. Nugraha baafb020b7 make "btrfs filesystem label" command actually work
This simple patch makes "btrfs filesystem label" command actually work.

On tmp branch, commit d1dc6a9, "btrfs filesystem label" functionality
was introduced. However the commit lacks one component that lets
"btrfs" accept "filesystem label" command.
Test case:

/dev/loop0

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label old on /dev/loop0
	nodesize 4096 leafsize 4096 sectorsize 4096 size 1.00GB
Btrfs Btrfs v0.19

old

new

FATAL: the filesystem has to be unmounted

new

Not sure if you need if you need a signoff for something as trivial as
this, but here it is just in case.

Signed-off-by: Fajar A. Nugraha <list@fajar.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Arne Jansen 2689259501 btrfs progs: fix extra metadata chunk allocation in --mixed case
When creating a mixed fs with mkfs, an extra metadata chunk got allocated.
This is because btrfs_reserve_extent calls do_chunk_alloc for METADATA,
which in turn wasn't able to find the proper space_info, as __find_space_info
did a hard compare of the flags. It is now sufficient for the space_info to
include the proper flag. This reflects the change done to the kernel code
to support mixed chunks.
Also for a subsequent chunk allocation (which should not be hit in the mkfs
case), the chunk is now created with the flags from the space_info instead
of the requested flags. A better solution would be to pull the full changeset
for the mixed case from the kernel into the user mode (or, even better, share
the code)

The additional chunk probably confused block_rsv calculation, which in turn
led to severeal ENOSPC Oopses.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Stephane Chazelas de07f367c4 incorrect argument checking for "btrfs sub snap -r"
Looks like this was missing in integration-20110626 for the
readonly snapshot patch:

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Hugo Mills dfa328ac4e btrfs-progs: Fix over-sized limit on buffer
gcc-4.4 complains (rightly) that the strncpy has a limit too large for
the array it's copying into. Use the correct array length.

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Andreas Philipp de750d7a0d Updated manpage for btrfs subvolume snapshot.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Andreas Philipp 97ecf6ad90 Test the additional ioctl.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Andreas Philipp 681c1d64a9 Support the new parameters in do_clone(int argc, char** argv).
Now 'btrfs subvolume snapshot' takes not two but only at least two
parameters. Additionally, the help message is updated accordingly.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Andreas Philipp b19c828f16 Add support for read-only subvolumes.
Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add
an option for the creation of a readonly snapshot.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:57 -04:00
Andreas Philipp 501a867d36 Added support for an additional ioctl.
Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as
defined in fs/btrfs/ioctl.h in the kernel sources.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:57 -04:00
Anton Blanchard fa81a569ac btrfs-progs: cast u64 to long long to avoid printf warnings
When building on ppc64 I hit a number of warnings in printf:

btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long
unsigned int’, but argument 4 has type ‘u64’

Fix them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:57 -04:00
Chris Ball fcdc0929c6 Fix unused-but-set errors in gcc-4.6
gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by
default, which breaks the build when combined with -Wall, e.g.:

debug-tree.c: In function ‘print_extent_leaf’:
debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

This patch fixes the errors by removing the unused variables.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Hubert Kario 29e6fc2aa6 add detailed help messages to btrfs command
extend the

        btrfs <cmd> --help

command to print detailed help message if available but fallback to
basic help message if detailed is unavailable

add detailed help message for 'filesystem defragment' command

little tweaks in comments

Signed-off-by: Hubert Kario <kario@wit.edu.pl>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Hubert Kario d388a77636 add advanced use of --help to help message
explain how to use

        btrfs <cmd> --help

command in help message

Signed-off-by: Hubert Kario <kario@wit.edu.pl>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Jan Schmidt 42f9568bfd mkfs should initialize unused fields properly
we discovered speed setting is (probably unintentionally) initialized to 1 in make_btrfs(), while being initialized to 0 in btrfs_add_to_fsid(). initialization in make_btrfs() is due to reuse of buf after pwrite() without clearing it. consequently, code like

 	btrfs_set_extent_generation(buf, extent_item, 1);

writes to the same location in buf where speed will be placed, later. It may be a good idea to clear buf after each pwrite(), though leaving the struct btrfs_header intact.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Tsutomu Itoh c55248003c btrfs-progs: setting of time to the root directory
This patch adds the setting of time to the root directory to the
mkfs.btrfs command.
As a result, the time of the mount point not correctly displayed
comes to be displayed correctly.

[before]
 # mkfs.btrfs /dev/sdd10
 # mount /dev/sdd10 /test1
 # ls -ld /test1
 dr-xr-xr-x 1 root root 0 Jan  1  1970 /test1

[after]
 # date
 Tue Nov 16 18:06:05 JST 2010
 # mkfs.btrfs /dev/sdd10
 # mount /dev/sdd10 /test1
 # ls -ld /test1
 dr-xr-xr-x 1 root root 0 Nov 16 18:06 /test1

Thanks,
Tsutomu

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Christoph Hellwig 43a06f07c7 btrfs-progs: add discard support to mkfs
Discard the whole device before starting to create the filesystem structures.
Modelled after similar support in mkfs.xfs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-25 09:18:32 -04:00
Miao Xie b4d668ee6b btrfs-progs: fix wrong extent buffer size when reading tree block
the root extent buffer of a tree may not be a leaf, so we must get the right
size by its level when reading it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-25 09:18:31 -04:00
Donggeun Kim 4e64e05c6b btrfs-progs: Add new feature to mkfs.btrfs to make file system image file from source directory
Changes from V1 to V2:
- support extended attributes
- move btrfs_alloc_data_chunk function to volumes.c
- fix an execution error when additional useless parameters are specified
- fix traverse_directory function so that the insertion functions for the common items are invoked in a single point

The extended attributes is implemented through llistxattr and getxattr function calls.

Thanks

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-25 09:18:31 -04:00
Mitch Harder 25095966bd Btrfs-progs: Update man page for mixed data+metadata option.
Update the mkfs.btrfs man page for the -M option to mix data and
metadata chunks.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-25 09:18:31 -04:00