Pavel Emelyanov <xemul@xxxxxxxxxxxxx> writes: >> The attr_version thing is about making sure that we don't update the >> kernel's cached attribute with stale data from the userspace filesystem. >> E.g. if a GETATTR races with a WRITE then by the time the GETATTR >> finishes write may have already updated i_size despite the fact that >> GETATTR is returning i_size before the write. In that case we don't >> store the i_size we believe is stale but we do use it the stat(2) reply, >> since it came from the userspace filesystem, which is the authoritative >> source of information. >> >> But that means that if we want stat(2) to work correctly, then we must >> flush the updated i_mtime to userspace before we do the GETATTR. > > Why? Isn't it enough just to look at the per-inode flag (you're talking > below) and take either cached i_mtime value or the user-space verion > of it? That would only work if the kernel has the more up-to-date mtime value, which is not necessarily true. Thanks, Miklos -- 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