Why generic_fillattr() is not protected with a lock?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I noticed that almost all local disk file systems use the default
vfs_getattr()->generic_fillattr() to get file attributes. However,
vfs_getattr()->generic_fillattr() is not protected by a lock. Is this
problematic?

Suppose process A is getting file attributes, after it read the
"mtime" and before it read the i_size, the process is scheduled out,
and another process B cuts in, change the file, and cause the change
on file size. After A is switched back, it goes ahead to read the rest
fields. Now it will have an old "mtime" but a new "i_size".

Is this scenario possible? If so, will this cause serious problem to
the file system?

Thanks,
Xin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux