linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why generic_fillattr() is not protected with a lock?
@ 2006-08-25  2:08 Xin Zhao
  0 siblings, 0 replies; only message in thread
From: Xin Zhao @ 2006-08-25  2:08 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-25  2:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-25  2:08 Why generic_fillattr() is not protected with a lock? Xin Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).