summaryrefslogtreecommitdiff
path: root/cmds-send.c
Commit message (Collapse)AuthorAge
* Btrfs-progs: btrfs-send: free used memory and close fdsStefan Behrens2013-04-23
| | | | | | | | Not important at all since exit() is called afterwards and this is not part of the library. It just makes valgrind happy and thus allows to search for real flaws. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* btrfs-progs: Fix the receive code pathingAlex Lyakas2013-04-23
| | | | | | | | | | | | | The receive code was not distinguishing properly between the mount root and the directory to create the received subvolume in. Also make sure the find_mount_root reports an error if it cannot find a match at all. Reported-by: Robert Buhren <robert@robertbuhren.de> Reported-by: Rory Campbell-Lange <rory@campbell-lange.net> Reported-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag> Signed-off-by: Alex Lyakas <alex.btrfs@zadarastorage.com> Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* Btrfs-progs: cleanup subvol_uuid_search memory in btrfs send/receiveStefan Behrens2013-04-23
| | | | | | Call the cleanup function that was introduced with the other commit. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* Btrfs-progs: close file descriptor in cmds-send.cStefan Behrens2013-04-23
| | | | | | valgrind found this very obvious issue. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* Btrfs-progs: Use /proc/mounts instead of /etc/mtabStefan Behrens2013-04-09
| | | | | | | | /etc/mtab is not working correctly in situations where multiple mount namespaces are used. Use /proc/mounts instead like the rest of the code is doing it. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* btrfs-progs: initialize pipefd[] for error pathEric Sandeen2013-02-05
| | | | | | | | | | | Several goto out; paths will end up doing i.e. if (pipefd[0]) close(pipefd[0]); but we get there with uninitialized values in many cases. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Btrfs-progs: make get_subvol_name non cmds-send specificAnand Jain2013-02-01
| | | | | | | | get_subvol_name can be used other than the just with in cmds-send.c so this patch will make it possible with out changing the original intentions. Signed-off-by: Anand Jain <anand.jain@oracle.com>
* Btrfs-progs: Complete the help information of btrfs send/receiveChen Yang2013-02-01
| | | | | | | | | | When typing command "btrfs send --help" or "btrfs receive --help", the help information of the commands is incomplete, which only shows a short usage. This patch helps to display the complete infomation of the commands. Signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com>
* Btrfs-prog/send: fix wrong dump_fd check in cmd_send_start()Chen Yang2013-01-31
| | | | | | | | In cmd_send_start(), there is a check to make sure dump_fd is not a tty before parsing command options. So if we use the option "-f file", it doesn't work for the dump_fd has not been created. So fix it. Signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com>
* Btrfs-prog/send: fix wrong best-parent assignment in, find_good_parent()Chen Yang2013-01-25
| | | | | | | | | We use find_good_parent() to look for a suit snapshot in the clone source snapshots as the parent, not the source subvolume of the snapshot which is about to be sent. fix it Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com>
* Btrfs-progs: correcting misnamed parameter options for btrfs sendJan Schmidt2013-01-21
| | | | | | | | | | | | Unfortunately, the command line options for btrfs send were misnamed. The -i option should not be used to give "clone sources", we'll be using -c instead. Compatibily note: -i option was broken anyway, which makes it less critical renaming it. For potential users of the old option style, we emit a fatal warning if the -i option is used. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
* btrfs-progs: initialize data before send ioctlArvin Schnell2013-01-21
| | | | | | | Likely not strictly needed but I noticed valgrind complaining about uninitialised memory in the ioctl call. Signed-off-by: Arvin Schnell <aschnell@suse.de>
* btrfs-progs: Fix getopt on arm platformsLluis Batlle i Rossell2013-01-17
| | | | | | | There, 'char' is unsigned, so once assigned '-1' from getopt, it gets the value 255. Then, it compared to '-1' gives false. Signed-off-by: Lluis Batlle i Rossell <viric@viric.name>
* btrfs-progs: do not send stream into a terminalDavid Sterba2013-01-17
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: Fix compiler warnings on PPC64Wade Cline2013-01-17
| | | | | | | | | | | | | | | | The kernel uses unsigned long long for u64, but PPC64 uses unsigned long by default. This results in compilation warnings such as: print-tree.c:333: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type 'u64' To fix this, the macro __KERNEL__ needs to be defined before including the file <asm/types.h>. This can be done by defining the macro in "kerncompat.h" and making it the first included file in the relevant header files; this fixes the compiler warnings on PPC64. Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Wade Cline <clinew@linux.vnet.ibm.com>
* Btrfs-progs: fix several complie warningMiao Xie2012-10-04
| | | | | | | | | | | | | | This patch fixed the following warning: cmds-send.c:464:6: warning: ‘ret' may be used uninitialized in this function [-Wuninitialized] crc32c.c:121:1: warning: control reaches end of non-void function [-Wreturn-type] send-utils.c:69:11: warning: ‘comp' may be used uninitialized in this function [-Wuninitialized] send-utils.c:126:6: warning: ‘comp' may be used uninitialized in this function [-Wuninitialized] send-utils.c:99:22: warning: ‘entry' may be used uninitialized in this function [-Wuninitialized] btrfs.c:261:2: warning: implicit declaration of function ‘crc32c_optimization_init' [-Wimplicit-function-declaration] btrfs.c:105:2: warning: ‘cmd' may be used uninitialized in this function [-Wuninitialized] restore.c:435:12: warning: ignoring return value of ‘ftruncate', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* Btrfs-progs: replace find_mount_root from send codeJan Schmidt2012-08-20
| | | | | | | | | | | find_mount_root had the problem that it tried to conclude from a file system path to a mount point, taking the fsid as an indicator. This only works if no two subvolumes (sharing the same btrfs fsid) are mounted in the same hierarchy. Now instead, we're parsing /etc/mtab and look for the longest match. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
* Allow relative paths for btrfs sendChris Mason2012-08-09
| | | | | | | | The initial btrfs send code was easily confused by relative paths and by anything that wasn't in the root of the FS. This fixes it to take relative paths. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add btrfs send/receive commandsAlexander Block2012-07-26
Add user space commands for btrfs send/receive. Signed-off-by: Alexander Block <ablock84@googlemail.com> Reviewed-by: David Sterba <dave@jikos.cz> Reviewed-by: Arne Jansen <sensille@gmx.net> Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Reviewed-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>