xfs
[Top] [All Lists]

Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling
From: Felix Blyakher <felixb@xxxxxxx>
Date: Thu, 27 Aug 2009 01:40:08 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20090827031242.GB6147@xxxxxxxxxxxxx>
References: <20090827031242.GB6147@xxxxxxxxxxxxx>

On Aug 26, 2009, at 10:12 PM, Christoph Hellwig wrote:

[Note: this patch needs the O_SYNC patch applies first]

I assume O_SYNC is not a prerequisite to this patch, it's just
needed to apply the current patch cleanly.


This is picking up on Felix's repost of Dave's patch to implement a
.dirty_inode method.  We really need this notification because
the VFS keeps writing directly into the inode structure instead
of going through methods to update this state.  In addition to
the long-known atime issue we now also have a caller in VM code
that updates c/mtime that way for shared writeable mmaps.  And
I found another one that no one has noticed in practice in the FIFO
code.

So implement ->dirty_inode to set i_update_core whenever the
inode gets externally dirties, and switch the c/mtime handling to
the same scheme we already use for atime (always picking up
the value from the Linux inode).

Note that this patch also removes the xfs_synchronize_atime call
in xfs_reclaim - it was not only superflous (we'll never reclaim
a dirty inode), but also didn't do anything (I_CLEAR is always set
at this point).  I replaced it with a myriad of ASSERTs for now
to make my point.

I like that ^)



Also switch to just using file_update_time for regular reads/writes -
that will get us all optimization done to it for free and make
sure we notice early when it breaks.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Felix Blyakher <felixb@xxxxxxx>

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