Re: [PATCH] Add flag to files with blocks intentionally past EOF

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Dilger
Date: Thursday, January 21, 2010 - 5:32 pm

On 2010-01-20, at 02:03, Aneesh Kumar K. V wrote:

Since this flag is set on disk in the inode flags, it makes sense to  
allow clearing it via "chattr", just like "chattr +e" will remap a  
file to extent format.  The risk with setting it via truncate() is  
that this is racy with some other process writing to the file.  If we  
allow setting it via "chattr" this can be done in a non-racy manner,  
by locking the inode and dropping only the blocks beyond EOF.



Sure it will be simpler, but less useful.  The point of exposing this  
flag via lsattr is to allow userspace to determine which files are  
holding blocks beyond EOF, so that if the filesystem is getting too  
full it is possible to run e.g. "lsattr -R" and find files with this  
EOF attribute and truncate them.  Without keeping at least the  
EOFBLOCKS flag in USER_VISIBLE this is impossible.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Add flag to files with blocks intentionally pa ..., Aneesh Kumar K. V, (Wed Jan 20, 2:03 am)
Re: [PATCH] Add flag to files with blocks intentionally pa ..., Aneesh Kumar K. V, (Wed Jan 20, 2:15 am)
Re: [PATCH] Add flag to files with blocks intentionally pa ..., Andreas Dilger, (Thu Jan 21, 5:32 pm)