>>>>> " " == Alexander Viro <[EMAIL PROTECTED]> writes:
>> Wrong. This is done routinely on all networked filesystems. It
>> has to be - only the server has full up to date knowledge of
>> those values (unless the protocol happens to support
>> delegation). On these filesystems, you want to ensure that
>> updates don't screw up the tests and local changes in the
>> generic read and write code in mm/filemap.c (amongst other
>> things) and hence all calls into generic_file_* are also
>> protected by the BKL.
> What the hell does it have to ->lookup()? And in any case,
Lookup of hard links files, and such.
Also whenever one open()s a file one wants to revalidate the inode in
order to ensure that the data cache is consistent. At the moment, the
only place that can be done is in ->d_revalidate() (->open() is
too late as you can't back up path_walk() if the cached inode turns
out to be stale).
> BKL on generic_file_* is a huge overkill. You need to protect
> what?
-> i_size? And for that you take BKL over a huge chunk of code,
99%
> of which doesn't give a damn for i_size?
Hmm... Looking at the code again, I seem to be out of step. Somebody
(you?) seems to have changed it since I last checked. We seem to have
moved the updating of i_size from mm/filemap into
commit_write(). Problem is that the lock_kernel() is dropped just
before the update.
Looking again, we can probably do without lock_kernel() around most of
nfs_updatepage(), and could instead put it around the update of
i_size (or better still, replace BKL with an NFS-specific spinlock).
> What we ought to do in 2.5.early (possibly - in 2.4) is to
> add ->max_page to address_space. I.e. ->i_size in pages. Then
> the latter becomes private to fs and the former is
> automatically atomic (all changes are under i_sem and read
> vs. assign is OK since it's int; the only problem with i_size
> is in partial update of 64bit value seen by reader).
Sounds good.
Cheers,
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]