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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Nov 2007 04:17:16 +0100
From:	Jörn Engel <joern@...fs.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp>,
	linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] ext3,4:fdatasync should skip metadata writeout

On Thu, 15 November 2007 18:59:19 -0800, Andrew Morton wrote:
> On Fri, 16 Nov 2007 11:47:27 +0900 Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp> wrote:
> 
> > Currently fdatasync is identical to fsync in ext3,4.
> > I think fdatasync should skip journal flush in data=ordered and data=writeback mode
> > because this syscall is not required to synchronize the metadata.
> 
> I suppose so.  Although one wonders what earthly point there is in syncing
> a file's data if we haven't yet written out the metadata which is required
> for locating that data.
> 
> IOW, fdatasync() is only useful if the application knows that it is overwriting
> already-instantiated blocks.
> 
> In which case it might as well have used fsync().  For ext2-style filesystems,
> anyway.

fsync() will sync an inode even if only i_atime was changed.
fdatasync() would ignore such changes.  I guess atime was the major
reason for creating fdatasync() in the first place.

The patch I sent you just minutes ago sorta documents this.
I_DIRTY_DATASYNC was added with patch-2.4.0-test12 for just this reason.

So basically an application can almost always use fdatasync() instead of
fsync() and rely on the kernel to only cut corners, if doing so will not
endanger the data synced to disk.

Jörn

-- 
Joern's library part 6:
http://www.gzip.org/zlib/feldspar.html
-
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