public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Question related to XFS sync , especially fsync
@ 2008-01-14 12:14 Gopala Krishna
  2008-01-14 12:24 ` Gopala Krishna
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Gopala Krishna @ 2008-01-14 12:14 UTC (permalink / raw)
  To: xfs

Hi,
I am seeing some strange problem with XFS and would like to know  the
expected behavior and if it is faulty is there any patches to resolve the
problem.

Problem:
======
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)  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.

It is happening only when I copy new file to XFS.  But, when I unmount the
file system and remount it, everything goes fine and I could get all
expected meta data information and proper value for dimode (in the inode
structure which indicates the type of the file, i.e regular directory etc.)
.

Once I mount it back and later even if I remove the same file and copy it
back to XFS and then run my utility program, I could read mode information
properly. But If I copy different file, again I could not get dimode
properly. I have to unmount and remount to get the mode properly to make my
utility program to display information properly. Once it starts getting
proper mode value, it continues.

So I am suspecting, even after calling fsync (which says it would block
untill it flushes metadata information to disk ), is not really flushing. So
only during unmount, it flushes metadata and hence I could get dimode
properly. since after remounting , by reading metadata information , I could
get mode properly and differentiate directory or regular file, and also it
is filling magic etc. properly, I feel the data I am reading is right and
that I could compare with stat system call and ls commands.

If I am doing something wrong and no problem with XFS, then I should not get
mode field properly even after unmount/remount operation.

Is there any problem with XFS fsync? Why dimode is getting updated only
during unmount? why not when I call fsync? Because fsync says it has to
flush all meta dat to disk before existing.

Please let me know your feedback.


[[HTML alternate version deleted]]

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-01-17  2:44 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-14 12:14 Question related to XFS sync , especially fsync Gopala Krishna
2008-01-14 12:24 ` Gopala Krishna
2008-01-14 12:25   ` Gopala Krishna
2008-01-14 14:06 ` Andi Kleen
2008-01-14 14:32 ` Olaf Frączyk
2008-01-14 14:43 ` ***** SUSPECTED SPAM ***** " Matthias Schniedermeyer
2008-01-14 17:55 ` Chris Wedgwood
2008-01-14 22:42 ` David Chinner
2008-01-15 13:44   ` Gopala Krishna
2008-01-15 15:18     ` Eric Sandeen
2008-01-15 22:26       ` Nathan Scott
2008-01-16  6:43         ` Gopala Krishna
     [not found]           ` <20080116064840.GA5725@puku.stupidest.org>
2008-01-16  7:25             ` Gopala Krishna
2008-01-16  7:52               ` Iustin Pop
2008-01-16  8:11                 ` Gopala Krishna
2008-01-16  8:25               ` Christoph Hellwig
2008-01-16  9:00                 ` Gopala Krishna
2008-01-16 11:52                   ` Mark Goodwin
2008-01-16 21:17                     ` Martin Steigerwald
2008-01-16 23:38                       ` Mark Goodwin
2008-01-17  1:25               ` Andi Kleen
2008-01-17  2:44                 ` David Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox