breaking leases on metadata changes

J. Bruce Fields bfields at redhat.com
Wed Sep 21 08:58:11 MDT 2011


So there's this longstanding problem that read leases should really be
broken on anything that changes an inode's metadata or any change to the
set of links pointing to the inode.

(Cc'ing samba-technical for confirmation of that statement from Samba's
point of view....)

So we need mutual exclusion between read leases and link, unlink,
rename, etc.

After contemplating increasingly complicated solutions for much too
long, I realized that the i_mutex is taken by all of those operations
except for rename--and it looks to me like rename could take i_mutex on
a renamed file as well.

So, here's my attempt.  It passes some simple tests.  Is it sane?

I tried updating Documentation/filesystems/directory-locking to reflect
the rename change, but without thinking it through as carefully as I'd
like to.

Also, the one thing I *know* is wrong: lockdep doesn't like the rename
change, and I haven't tried to figure out how to fix it.  (Help?)

These patches assume some previous lease fixes already committed to

	git://linux-nfs.org/~bfields/linux.git for-3.2

--b.


More information about the samba-technical mailing list