All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: xiaohui li <lixiaohui1@xiaomi.corp-partner.google.com>
Cc: "Xiaohui1 Li 李晓辉" <lixiaohui1@xiaomi.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"harshadshirwadkar@gmail.com" <harshadshirwadkar@gmail.com>
Subject: Re: 答复: [External Mail]Re: [PATCH v3 09/13] ext4: fast-commit commit path changes
Date: Sun, 3 Nov 2019 22:22:12 -0500	[thread overview]
Message-ID: <20191104032212.GA12046@mit.edu> (raw)
In-Reply-To: <CAAJeciVYOAWzsjAtL7SNmpFQH60z0MB53OPE3hZ==_oBB0N3dQ@mail.gmail.com>

On Mon, Nov 04, 2019 at 09:01:28AM +0800, xiaohui li wrote:
> 
> when in writeback mode, inode' data has not to be waited in jbd2
> thread, so the fsync time cost is also reduced.
> meawhile, writeback mode also can guarantee filesystem consistency in
> os crash-reboot conditions,
> with only one drawback is that it will cause security problems such as
> stale data will be seen.

It's not just stale data; in data=writeback, today if a file gets
deleted, its blocks are immediately eligible to be reused.  If there
is a crash before the transaction is committed, there could be a file
that would have deleted (and perhaps replaced) that doesn't in fact
get deleted, but its data blocks will have been corrupted.

I'm not fond of that particular behavior, and I may look to fix it,
but in general, data=writeback means that data blocks may be corrupted
or contain stale data after a crash --- for blocks that were freshly
created, or for a file that might have been deleted, but except for
the crash which means that the file deletion doesn't actually get
corrupted.

> but in android system with file encryption enabled, there is no
> security problem as files are all encryped.
> but user will see wrong file data in system crash-reboot conditions
> with writeback mode enabled.

If all files are encrypted, then yes, the chances of stale data
causing security issues is significantly reduced.

But see also the case of a file which is deleted immediately before a
crash.  Things are more complex in terms of the data gauarantees after
a crash, which is why data=ordered is the default.

Regards,

					- Ted

  reply	other threads:[~2019-11-04  3:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1571900042725.99617@xiaomi.com>
2019-10-24 20:18 ` [PATCH v3 09/13] ext4: fast-commit commit path changes Theodore Y. Ts'o
     [not found]   ` <1572349386604.43878@xiaomi.com>
2019-10-29 21:35     ` Theodore Y. Ts'o
2019-10-30  4:28       ` 答复: [External Mail]Re: " Xiaohui1 Li 李晓辉
2019-10-30 14:26         ` Theodore Y. Ts'o
2019-11-04  1:01           ` xiaohui li
2019-11-04  3:22             ` Theodore Y. Ts'o [this message]
2019-11-08  7:58               ` xiaohui li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191104032212.GA12046@mit.edu \
    --to=tytso@mit.edu \
    --cc=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=lixiaohui1@xiaomi.com \
    --cc=lixiaohui1@xiaomi.corp-partner.google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.