* [PATCH] btrfs-progs: cmd_find_new: Sync fs before searching for modified files.
@ 2013-09-23 18:17 chandan
2013-09-23 18:19 ` chandan
0 siblings, 1 reply; 2+ messages in thread
From: chandan @ 2013-09-23 18:17 UTC (permalink / raw)
To: linux-btrfs; +Cc: sekharan
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>
---
cmds-subvolume.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index de246ab..8832303 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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-23 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 18:17 [PATCH] btrfs-progs: cmd_find_new: Sync fs before searching for modified files chandan
2013-09-23 18:19 ` chandan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).