lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 13 Aug 2015 13:47:12 +0000
From:	Alexey Skidanov <Alexey.Skidanov@...disk.com>
To:	"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
CC:	"alexey.skidanov@...il.com" <alexey.skidanov@...il.com>
Subject: fsync and journal_async_commit mount options

Hi,

Some partition on my device is mounted with  journal_async_commit option. I paid attention that fsync() system call doesn't cause to flush request to be sent. Looking in the source code of ext4_sync_file I understand that only if the barrier option is on the flush request will be issued:

	if (journal->j_flags & JBD2_BARRIER &&
	    !jbd2_trans_will_send_data_barrier(journal, commit_tid))
		needs_barrier = true;
                ...
	if (needs_barrier) {
		err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
                               ...
	}

The fsync mainly used to ensure the data is actually written on backing device. The man page says:

fsync() transfers ("flushes") all modified in-core data of (i.e., modified buffer cache pages for) the file referred to by the file descriptor fd to the disk device (or other permanent storage device) so that all changed information can be retrieved even after the system crashed or was rebooted. This includes writing through or flushing a disk cache if present.

The barrier is a mount option imposing some ordering on journaling transactions - journaling content and journaling commit. So why  the flush request is issued only if the journal ordering is imposed by barrier option?

Thanks
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ