Re: [PATCH v2] Introduce the end_syncfs option

Vincent Fu <[email protected]> Mon, 26 Jan 2026 21:15:57 -0500
Newsgroups org.kernel.vger.fio
Message-ID <CAOp=CXnJ3Sr2ZGDjiAHdPhi4eKfUo-RtJ0h1oF072ew+Xfcy7Q@mail.gmail.com>
On Mon, Jan 26, 2026 at 9:05 PM Damien Le Moal <[email protected]> wrote:
>
> On 1/27/26 10:01, Vincent Fu wrote:
> > On Mon, Jan 26, 2026 at 1:22 AM Damien Le Moal <[email protected]> wrote:
> >>
> > <snip>
> >>                 }
> >> +
> >> +               if (td->o.end_syncfs) {
> >> +                       td_set_runstate(td, TD_FSYNCING);
> >> +
> >> +                       for_each_file(td, f, i) {
> >> +                               if (fio_file_syncfs(td, f))
> >> +                                       log_err("fio: end_syncfs failed\n");
> >> +                               break;
> >
> > This seems like it will break out of the loop after syncfs-ing the first file.
> > Is this intentional or should fio break only if there is an error?
>
> It is intentional and it is the entire point of this patch: doing syncfs for the
> first file will sync the entire FS, so all the other files will be sync-ed as
> well. We thus avoid the entire loop on all files which is extremely slow when
> running with a large number of files. We only need to do syncfs() once for the
> first file. Ideally, we should do it for the directory specified for the files,
> but that is a little more involved as a change.

Ok thank you for clarifying.
Please emphasize in the documentation that this feature assumes that
all files will reside on the same file system.

Vincent