Re: [patch 00/13] vfs: add helpers to check r/o bind mounts

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Erez Zadok
Date: Thursday, April 24, 2008 - 12:56 pm

In message <20080424173013.GA5882@ZenIV.linux.org.uk>, Al Viro writes:

When you say "that one", do you mean the sb-level idea?  If the sb-level
"want write" not provide exclusion among writers, then how can I prevent
lower topology changes while copyup takes place?

If your sb-level "want write" idea won't provide that exclusion at the sb
level, then how about we elevate the s_vfs_rename_mutex into a generic
s_vfs_multi_dir_change_mutex of sorts, which can be used by rename as well
as copyup?


OK.  lock_rename() at most locks one "parent" and one "child" inodes.  So
what happens to all the ones in b/t?  Suppose I have a path /a/b/c/d/e/f and
someone wants to mv /a/b/c/d/e to /a/b/; in that case lock_rename at least
grabs the mutex on /a/b, right?  Can someone go in the middle and try to
muck with the "c/d/" parts in between?

From what I gathered, lock_rename won't be enough for me to prevent topology
changes during copyup; I'd really need to lock an entire arbitrarily deep
path of inodes.  That just seems so complex and prone to bugs, that it might
just be easier to have a single sb-level mutex for these complex
multi-directory operations.  I'm not sure how much performance hit this'd
be, thou, and if there's a more efficient way to do so.

If you think lock_rename will be sufficient for me to deal with copyups
vs. topology changes, then I'll start using it.

Thanks,
Erez.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 4:39 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:23 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 11:47 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts , Erez Zadok, (Thu Apr 24, 12:56 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Thu Apr 24, 1:16 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Thu Apr 24, 4:33 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Fri Apr 25, 12:22 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Mon Apr 28, 7:20 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, J. Bruce Fields, (Mon Apr 28, 2:53 pm)