xfs
[Top] [All Lists]

Re: Question related to XFS sync , especially fsync

To: "Gopala Krishna" <gopalakrishna.n.m@xxxxxxxxx>
Subject: Re: Question related to XFS sync , especially fsync
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Mon, 14 Jan 2008 15:06:32 +0100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <d711080c0801140414n48e47140y88f545eba605eff9@xxxxxxxxxxxxxx> (Gopala Krishna's message of "Mon\, 14 Jan 2008 17\:44\:22 +0530")
References: <d711080c0801140414n48e47140y88f545eba605eff9@xxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
"Gopala Krishna" <gopalakrishna.n.m@xxxxxxxxx> writes:
> ======
> Basically I am extracting metadata information for a given file by reading
> the inode structure from the particular disk offset (based on it's  position
> calculated by published inode structure and super block structure
>  information). Before reading the metada data information from the disk, I
> am calling fsync (I used to call sync, but later I changed to fsync, since
> sync is not guranteed to flush all meta data) 

sync is guaranteed to flush all metadata. But it has other problems
like livelocks.

 to ensure all metadata
> related to file is flushed to disk. Later I am reading particular disk
> offset as per calculation.   I am getting XFS magic field properly after
> mapping to XFs inode structure. However I am not getting dimode properly in
> some cases (not all cases) and it shows 00000 even for regular file and
> directory.

I suspect it's flushed to the log only. You could probably write some other
metadata until the log is completely full and fsync it, then eventually
the first change should be guaranteed to be flushed to the rest of 
the disk.

> If I am doing something wrong 

Well yes it sounds certainly weird what you're attempting.

-Andi


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