summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorchandan <chandan@linux.vnet.ibm.com>2013-09-23 23:47:11 +0530
committerChris Mason <chris.mason@fusionio.com>2013-10-16 08:23:11 -0400
commitc31c50f3309110162f345b6b07389ff6e7e929d4 (patch)
tree149b038b56115076c54ff016f503051993a70e4d /cmds-subvolume.c
parent844034adba58d2af50dc01ac36a0ba817ca3df9c (diff)
btrfs-progs: cmd_find_new: Sync fs before searching for modified files.
The sync makes sure that 'very recently' introduced delayed work is accounted for in the output of 'btrfs subvolume find-new' command. Signed-off-by: chandan <chandan@linux.vnet.ibm.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index de246abd..8832303c 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -786,6 +786,15 @@ static int cmd_find_new(int argc, char **argv)
fprintf(stderr, "ERROR: can't access '%s'\n", subvol);
return 1;
}
+
+ ret = ioctl(fd, BTRFS_IOC_SYNC);
+ if (ret < 0) {
+ fprintf(stderr, "ERROR: unable to fs-syncing '%s' - %s\n",
+ subvol, strerror(errno));
+ close_file_or_dir(fd, dirstream);
+ return 1;
+ }
+
ret = btrfs_list_find_updated_files(fd, 0, last_gen);
close_file_or_dir(fd, dirstream);
return !!ret;