Re: Some qns on Ext2 Extended File Attributes

From: Stephen C. Tweedie (sct@redhat.com)
Date: Mon Aug 28 2000 - 09:00:02 EST


Hi,

On Mon, Aug 28, 2000 at 09:23:00AM +0200, Michael Kerrisk wrote:

> if ( IS_NOATIME (inode) ) return;
>
> in update_atime(), and briefly looking at other parts of the source seems
> to imply that this feature *is* present. However, a simple test (touch(1)
> on a file with this attribute set) seems to indicate that this feature is
> **not** implemented (since touch did change the file atime...). The
> original poster of the earlier LK thread also found this attribute did not
> seem to work. Have I missed something?

Yes. NOATIME only suppresses the automatic atime update when you read
from a file. The timestamp is still there, even if it isn't being
updated automatically. If you run touch(8) to set the atime manually,
then the filesystem will still honour that request.

> EXT2_NODUMP_FL (chattr +d file) Do not backup file with dump(8)
>
> I ran a quick test with dump(8), and it seems to ignore this attribute
> (i.e. files with this attribute got backed up anyway). Does this
> attribute have any effect anywhere?

Yes. dump(8) has an option which lets you specify which level of dump
will honour the NODUMP flag. By default, level 0 dumps ignore NODUMP,
so that full dumps backup the entire filesystem but incremental dumps
skip NODUMP files.

> EXT2_SYNC_FL (chattr +S file) Make file updates synchronous
>
> Either I'm misunderstanding how this attribute works or it doesn't seem to
> be implemented. I had expected that setting this flag would force later
> opens for writing on a file to behave as if O_SYNC had been specified.

No, it specifies that _directory_ updates are made synchronously. For
file writes you still need to open them O_SYNC. The combination of
O_SYNC (or fsync) on files, plus chattr +S on the directory, ensures
that both the file _and_ the filename will be safe after reboot.
O_SYNC on its own can only guarantee the data, not the filename, which
is why the SYNC_FL attribute was added.

Cheers,
 Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:21 EST