[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD+ocbwK9v=ky+bBtMuVMP+zDNYnTSO2DjPZ4sE1AnYw8iEmew@mail.gmail.com>
Date: Fri, 7 May 2021 09:22:24 -0700
From: harshad shirwadkar <harshadshirwadkar@...il.com>
To: Leah Rumancik <leah.rumancik@...il.com>
Cc: "Darrick J. Wong" <djwong@...nel.org>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
"Theodore Y. Ts'o" <tytso@....edu>
Subject: Re: [PATCH v3 2/3] ext4: add ioctl EXT4_IOC_CHECKPOINT
> > > > > + err = jbd2_journal_flush(EXT4_SB(sb)->s_journal,
> > >
> > > Huh. So we don't flush the filesystem at all, just the journal? I
> > > don't see anything in the documentation saying that syncfs() is a
> > > prerequisite.
>
> This is just for the journal, good point, I'll update the documentation.
It just occurred to me this morning that we need to ensure that a
*full* commit happens before IOC_CHECKPOINT and not a *fast* commit.
Fast commits cannot be checkpointed, they rely on full commits for
checkpoint operation. So, if a syncfs call results in a fast commit,
the following sequence of events will happen:
* Ext4 writes fast commit information in fast commit area
* When user calls EXT4_IOC_CHECKPOINT, the checkpoint operation would
result in checkpointing everything in the main journal, except things
written in fast commit area
* During the discard phase of EXT4_IOC_CHECKPOINT, fast commit area
will be discarded and thus we'll lose the log updates present in the
fast commit area
However, this isn't a problem today. Syncfs doesn't result in a fast
commit but results in a full commit. But, that can change at some
point in the future. So, unless we can either come up with syncfs()
variant that can induce a full commit (which would be a little ugly -
I don't think the user needs to know what kind of journal commit file
system is doing) or add checkpointing support in fast commits, we
should just do a full commit from the IOCTL code.
- Harshad
Powered by blists - more mailing lists