[Top] [All Lists]

Directory fsync

To: xfs@xxxxxxxxxxx
Subject: Directory fsync
From: Zhu Han <schumi.han@xxxxxxxxx>
Date: Fri, 23 Sep 2011 23:12:02 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=uh5e5FKC624G1oAj6evTFMK2fvfyPQ6n9az+utm8xGk=; b=hSwzZMPWSTyBe5I1Ac90scjsTxn/SqecQF5bd6mMw3q6IA0XJIFeY1RK49vnqXxfvN cuftS+38P+nbLxN9+5BXSL2iwfivOqU2TrEN0HZavIQrtsV0k8qk9EdcYnsoydFb1Gt2 Y9Q3uSmaC1NfTvcwF4yxB16G9MKLpJ0hbfg2w=
I note below words in the manual of fsync:
       Calling  fsync()  does  not  necessarily  ensure  that  the entry in the directory containing the file has also reached disk.  For that an explicit fsync() on a file
       descriptor for the directory is also needed.

I am wondering is directory sync is essential after below steps if I want to assure the file can be retrieved after system crash?

1) create file A
2) write file A
3) fsync(file A)

--------------------------------> fsync(parent directory) [Is it essential to make the inode linked to parent directory?]

<Prev in Thread] Current Thread [Next in Thread>