Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-15 Thread Peter Xu
On Mon, Jan 15, 2024 at 09:03:20AM +, Daniel P. Berrangé wrote: > On Mon, Jan 15, 2024 at 04:57:42PM +0800, Peter Xu wrote: > > On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > > > (2) Why metadata doesn't matter (v.s. fsync(), when CONFIG_FDATASYNC=y)? > > > > > > Syncing

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-15 Thread Daniel P . Berrangé
On Mon, Jan 15, 2024 at 04:57:42PM +0800, Peter Xu wrote: > On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > > (2) Why metadata doesn't matter (v.s. fsync(), when CONFIG_FDATASYNC=y)? > > > > Syncing the inode information is not critical, it's mostly timestamp > > information

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-15 Thread Peter Xu
On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > (2) Why metadata doesn't matter (v.s. fsync(), when CONFIG_FDATASYNC=y)? > > Syncing the inode information is not critical, it's mostly timestamp > information (man inode). And fdatasync makes sure to sync any metadata > that

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-14 Thread Peter Xu
On Fri, Jan 12, 2024 at 10:40:28AM +, Daniel P. Berrangé wrote: > On Fri, Jan 12, 2024 at 08:01:36AM +0800, Peter Xu wrote: > > On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > > > (1) Does this apply to all io channel users, or only migration? > > > > > > All file channel

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-12 Thread Daniel P . Berrangé
On Fri, Jan 12, 2024 at 08:01:36AM +0800, Peter Xu wrote: > On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > > (1) Does this apply to all io channel users, or only migration? > > > > All file channel users. > > I meant the whole idea of flushing on close, on whether there will

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-11 Thread Peter Xu
On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote: > > (1) Does this apply to all io channel users, or only migration? > > All file channel users. I meant the whole idea of flushing on close, on whether there will be iochannel users that will prefer not do so? It's a matter of where

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-11 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Nov 27, 2023 at 05:25:46PM -0300, Fabiano Rosas wrote: >> Make sure the data is flushed to disk before closing file >> channels. This will ensure data is on disk at the end of a migration >> to file. > > Looks reasonable, but just two (possibly naive) questions: > >

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-11 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:46PM -0300, Fabiano Rosas wrote: > Make sure the data is flushed to disk before closing file > channels. This will ensure data is on disk at the end of a migration > to file. Looks reasonable, but just two (possibly naive) questions: (1) Does this apply to all io

Re: [RFC PATCH v3 04/30] io: fsync before closing a file channel

2024-01-10 Thread Daniel P . Berrangé
On Mon, Nov 27, 2023 at 05:25:46PM -0300, Fabiano Rosas wrote: > Make sure the data is flushed to disk before closing file > channels. This will ensure data is on disk at the end of a migration > to file. > > Signed-off-by: Fabiano Rosas > --- > io/channel-file.c | 5 + > 1 file changed, 5

[RFC PATCH v3 04/30] io: fsync before closing a file channel

2023-11-27 Thread Fabiano Rosas
Make sure the data is flushed to disk before closing file channels. This will ensure data is on disk at the end of a migration to file. Signed-off-by: Fabiano Rosas --- io/channel-file.c | 5 + 1 file changed, 5 insertions(+) diff --git a/io/channel-file.c b/io/channel-file.c index