On Wed 18-12-24 00:32:24, wangjianjian0 wrote: > This may be a stupid question, ; -) > ksys_sync call sync_bdevs to write all block device mapping but it seems it doesn't issue a PREFLUSH request. > Without it, is it possible to lost data after a poweroff even though we have call sync() ? Generally, it is the responsibility of individual filesystems to issue cache flush requests as appropriate in their ->sync_fs() methods. Now if there's no filesystem on given block device (i.e., the block device is used directly), then I agree we fail to flush disk caches as a result of sync(2). On the other hand issuing cache flush unconditionally in sync_bdevs() will cause a lot of unnecessary cache flushing for mounted devices or if there were in fact no dirty data. So fixing this in a way that does not regress common case will be a bit tricky. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR