Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12322

Can the data=journal mode of EXT4 avoid user data loss?

$
0
0
  • journal mode

data=journal mode provides full data and metadata journaling. All newdata is written to the journal first, and then to its final location.

In the event of a crash, the journal can be replayed, bringing bothdata and metadata into a consistent state. This mode is the slowestexcept when data needs to be read from and written to disk at the sametime where it outperforms all others modes. Enabling this mode willdisable delayed allocation and O_DIRECT support.

Here I have a few questions, please take a look at it:

  1. Configure data=journal, then the user calls write(), does the write() return after the data is successfully written to the journal, or does it return the user success after entering the pagecache? If it is the latter, it means that the journal is submitted asynchronously, so the meaning of the journal of ext4 is to ensure the consistency of the file system itself, and there is no guarantee that user data will not be lost?

  2. If ext4 submits the journal asynchronously, when will the journal be triggered?

  3. Is there any other file system that allows the journal to be synchronized before write() returns successfully?

According to the results of my local experiments, it is inferred that the journal should be submitted asynchronously. I used a separate ssd partition as journal_dev. When I used fio to test and write files, I found that the io of journal_dev was intermittent, not always having IO.


Viewing all articles
Browse latest Browse all 12322

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>