On Thu, Jun 03, 2010 at 06:08:55AM +1000, Nick Piggin wrote: > xfs in the 0 length file shortcut, isn't this missing suid kill case? > (ftruncate mandatory mtime update seems like it wasn't working right > there either before this patch). The wording from Posix for truncate is: "Upon successful completion, if the file size is changed, this function shall mark for update the st_ctime and st_mtime fields of the file, and the S_ISUID and S_ISGID bits of the file mode may be cleared." and for truncate: "Upon successful completion, if fildes refers to a regular file, the ftruncate() function shall mark for update the st_ctime and st_mtime fields of the file and the S_ISUID and S_ISGID bits of the file mode may be cleared." Which translates to me that the suid/sgid clearing behaviour is exactly the same as the c/mtime update and it can be skipped for truncate only if there is no size change. Except that the wording is rather nasty as the suid/sgid bits are only accepted into Posix as an ugly headed stepchild and may not actually be present on some systems. Which means XFS behaviour for truncate while not strictly against Posix is at least unexpected. I'll fix it up. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html