linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [git pull] vfs pile 2 (automount work)
@ 2011-01-16 18:57 Al Viro
  2011-01-16 21:15 ` Joachim Eastwood
  0 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2011-01-16 18:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-fsdevel

	This pile consists mostly automount patchset by dhowells plus
fixes for related mainline bugs.  There's more, but I'd rather keep
pull requests separate; I'll send another one tonight and there will
be more on Monday.  Please, pull from

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus

Shortlog:
Al Viro (3):
      do_lookup() fix
      fix old umount_tree() breakage
      sanitize vfsmount refcounting changes

David Howells (11):
      Add a dentry op to handle automounting rather than abusing follow_link()
      Add a dentry op to allow processes to be held during pathwalk transit
      Add an AT_NO_AUTOMOUNT flag to suppress terminal automount
      AFS: Use d_automount() rather than abusing follow_link()
      NFS: Use d_automount() rather than abusing follow_link()
      CIFS: Use d_automount() rather than abusing follow_link()
      Remove the automount through follow_link() kludge code from pathwalk
      Remove a further kludge from __do_follow_link()
      Allow d_manage() to be used in RCU-walk mode
      Unexport do_add_mount() and add in follow_automount(), not ->d_automount()
      autofs4: Merge the remaining dentry ops tables

Ian Kent (9):
      autofs4: Add d_automount() dentry operation
      autofs4: Add d_manage() dentry operation
      autofs4: Remove unused code
      autofs4: Clean up inode operations
      autofs4: Clean up dentry operations
      autofs4: Clean up autofs4_free_ino()
      autofs4: Fix wait validation
      autofs4: Add v4 pseudo direct mount support
      autofs4: Bump version

Diffstat:
 Documentation/filesystems/Locking |    4 +
 Documentation/filesystems/vfs.txt |   43 +++
 drivers/mtd/mtdchar.c             |    2 +-
 drivers/staging/autofs/dirhash.c  |    5 +-
 fs/afs/dir.c                      |    1 +
 fs/afs/inode.c                    |    3 +-
 fs/afs/internal.h                 |    1 +
 fs/afs/mntpt.c                    |   56 +---
 fs/anon_inodes.c                  |    2 +-
 fs/autofs4/autofs_i.h             |   99 ++++--
 fs/autofs4/dev-ioctl.c            |    2 +-
 fs/autofs4/expire.c               |   51 ++--
 fs/autofs4/inode.c                |   26 +--
 fs/autofs4/root.c                 |  673 ++++++++++++++++---------------------
 fs/autofs4/waitq.c                |   17 +-
 fs/cifs/cifs_dfs_ref.c            |  120 +++----
 fs/cifs/cifsfs.h                  |    6 +
 fs/cifs/dir.c                     |    2 +
 fs/cifs/inode.c                   |    8 +-
 fs/dcache.c                       |    5 +-
 fs/fs_struct.c                    |   35 ++-
 fs/internal.h                     |    5 +
 fs/namei.c                        |  379 +++++++++++++++------
 fs/namespace.c                    |  179 +++++-----
 fs/nfs/dir.c                      |    4 +-
 fs/nfs/inode.c                    |    4 +-
 fs/nfs/internal.h                 |    1 +
 fs/nfs/namespace.c                |   79 ++---
 fs/nfsd/vfs.c                     |    5 +-
 fs/pipe.c                         |    2 +-
 fs/stat.c                         |    4 +-
 fs/super.c                        |    2 +-
 include/linux/auto_fs4.h          |    2 +-
 include/linux/dcache.h            |   16 +-
 include/linux/fcntl.h             |    1 +
 include/linux/fs.h                |    2 +
 include/linux/mount.h             |   11 +-
 include/linux/namei.h             |    5 +-
 include/linux/nfs_fs.h            |    1 -
 include/linux/path.h              |    2 -
 40 files changed, 1010 insertions(+), 855 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 18:57 [git pull] vfs pile 2 (automount work) Al Viro
@ 2011-01-16 21:15 ` Joachim Eastwood
  2011-01-16 21:36   ` Al Viro
  2011-01-16 21:37   ` Linus Torvalds
  0 siblings, 2 replies; 8+ messages in thread
From: Joachim Eastwood @ 2011-01-16 21:15 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, linux-kernel, linux-fsdevel

Hi,

On 1/16/11, Al Viro <viro@zeniv.linux.org.uk> wrote:
> Al Viro (3):
>       sanitize vfsmount refcounting changes

f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting changes

Breaks my ARM !CONFIG_SMP compile

  CC      fs/namespace.o
fs/namespace.c: In function 'commit_tree':
fs/namespace.c:629: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c: In function 'umount_tree':
fs/namespace.c:1192: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c: In function 'mnt_make_longterm':
fs/namespace.c:2246: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c: In function 'mnt_make_shortterm':
fs/namespace.c:2251: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c:2254: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c: In function 'dup_mnt_ns':
fs/namespace.c:2295: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c:2299: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c:2305: error: 'struct vfsmount' has no member named 'mnt_longterm'
fs/namespace.c: In function 'create_mnt_ns':
fs/namespace.c:2351: error: 'struct vfsmount' has no member named 'mnt_longterm'
make[1]: *** [fs/namespace.o] Error 1
make: *** [fs] Error 2

My configuration is arch/arm/configs/at91rm9200_defconfig.

regards
Joachim Eastwood

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:15 ` Joachim Eastwood
@ 2011-01-16 21:36   ` Al Viro
  2011-01-16 22:05     ` Joachim Eastwood
  2011-01-16 21:37   ` Linus Torvalds
  1 sibling, 1 reply; 8+ messages in thread
From: Al Viro @ 2011-01-16 21:36 UTC (permalink / raw)
  To: Joachim Eastwood; +Cc: Linus Torvalds, linux-kernel, linux-fsdevel

On Sun, Jan 16, 2011 at 10:15:31PM +0100, Joachim Eastwood wrote:
> Hi,
> 
> On 1/16/11, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > Al Viro (3):
> >       sanitize vfsmount refcounting changes
> 
> f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting changes
> 
> Breaks my ARM !CONFIG_SMP compile
> 
>   CC      fs/namespace.o
> fs/namespace.c: In function 'commit_tree':
> fs/namespace.c:629: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c: In function 'umount_tree':
> fs/namespace.c:1192: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c: In function 'mnt_make_longterm':
> fs/namespace.c:2246: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c: In function 'mnt_make_shortterm':
> fs/namespace.c:2251: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c:2254: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c: In function 'dup_mnt_ns':
> fs/namespace.c:2295: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c:2299: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c:2305: error: 'struct vfsmount' has no member named 'mnt_longterm'
> fs/namespace.c: In function 'create_mnt_ns':
> fs/namespace.c:2351: error: 'struct vfsmount' has no member named 'mnt_longterm'

Aaaaargh... Brown paperbag time - all testing was on SMP boxen ;-/  The fix
follows.  Linus, I've dropped that into for-linus in usual place
(git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/), so if you
prefer to pull it, it's there.

commit 91ed228ab50daa7aca54faa8bf5208b97e3448b8
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sun Jan 16 16:32:11 2011 -0500

    mnt_longterm is there only on SMP
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

diff --git a/fs/namespace.c b/fs/namespace.c
index 48809e2..9f544f3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -611,6 +611,21 @@ static void attach_mnt(struct vfsmount *mnt, struct path *path)
 	list_add_tail(&mnt->mnt_child, &path->mnt->mnt_mounts);
 }
 
+static inline void __mnt_make_longterm(struct vfsmount *mnt)
+{
+#ifdef CONFIG_SMP
+	atomic_inc(&mnt->mnt_longterm);
+#endif
+}
+
+/* needs vfsmount lock for write */
+static inline void __mnt_make_shortterm(struct vfsmount *mnt)
+{
+#ifdef CONFIG_SMP
+	atomic_dec(&mnt->mnt_longterm);
+#endif
+}
+
 /*
  * vfsmount lock must be held for write
  */
@@ -626,7 +641,7 @@ static void commit_tree(struct vfsmount *mnt)
 	list_add_tail(&head, &mnt->mnt_list);
 	list_for_each_entry(m, &head, mnt_list) {
 		m->mnt_ns = n;
-		atomic_inc(&m->mnt_longterm);
+		__mnt_make_longterm(m);
 	}
 
 	list_splice(&head, n->list.prev);
@@ -1189,7 +1204,7 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill)
 		list_del_init(&p->mnt_list);
 		__touch_mnt_namespace(p->mnt_ns);
 		p->mnt_ns = NULL;
-		atomic_dec(&p->mnt_longterm);
+		__mnt_make_shortterm(p);
 		list_del_init(&p->mnt_child);
 		if (p->mnt_parent != p) {
 			p->mnt_parent->mnt_ghosts++;
@@ -2243,16 +2258,18 @@ static struct mnt_namespace *alloc_mnt_ns(void)
 
 void mnt_make_longterm(struct vfsmount *mnt)
 {
-	atomic_inc(&mnt->mnt_longterm);
+	__mnt_make_longterm(mnt);
 }
 
 void mnt_make_shortterm(struct vfsmount *mnt)
 {
+#ifdef CONFIG_SMP
 	if (atomic_add_unless(&mnt->mnt_longterm, -1, 1))
 		return;
 	br_write_lock(vfsmount_lock);
 	atomic_dec(&mnt->mnt_longterm);
 	br_write_unlock(vfsmount_lock);
+#endif
 }
 
 /*
@@ -2292,17 +2309,17 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,
 	q = new_ns->root;
 	while (p) {
 		q->mnt_ns = new_ns;
-		atomic_inc(&q->mnt_longterm);
+		__mnt_make_longterm(q);
 		if (fs) {
 			if (p == fs->root.mnt) {
 				fs->root.mnt = mntget(q);
-				atomic_inc(&q->mnt_longterm);
+				__mnt_make_longterm(q);
 				mnt_make_shortterm(p);
 				rootmnt = p;
 			}
 			if (p == fs->pwd.mnt) {
 				fs->pwd.mnt = mntget(q);
-				atomic_inc(&q->mnt_longterm);
+				__mnt_make_longterm(q);
 				mnt_make_shortterm(p);
 				pwdmnt = p;
 			}
@@ -2348,7 +2365,7 @@ struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt)
 	new_ns = alloc_mnt_ns();
 	if (!IS_ERR(new_ns)) {
 		mnt->mnt_ns = new_ns;
-		atomic_inc(&mnt->mnt_longterm);
+		__mnt_make_longterm(mnt);
 		new_ns->root = mnt;
 		list_add(&new_ns->list, &new_ns->root->mnt_list);
 	}

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:15 ` Joachim Eastwood
  2011-01-16 21:36   ` Al Viro
@ 2011-01-16 21:37   ` Linus Torvalds
  2011-01-16 21:44     ` Al Viro
  1 sibling, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2011-01-16 21:37 UTC (permalink / raw)
  To: Joachim Eastwood; +Cc: Al Viro, linux-kernel, linux-fsdevel

On Sun, Jan 16, 2011 at 1:15 PM, Joachim  Eastwood <manabian@gmail.com> wrote:
>
> f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting changes
>
> Breaks my ARM !CONFIG_SMP compile

In fact, any non-SMP compile, it's not ARM-specific.

The simple fix for the build breakage should be to just move the
mnt_longterm thing out of the #ifdef CONFIG_SMP in
include/linux/mount.h. But I do worry that it would cause some count
imbalance, because there are some accesses that are still inside that
CONFIG_SMP case in mntput_no_expire().

Al, please take a look,

                 Linus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:37   ` Linus Torvalds
@ 2011-01-16 21:44     ` Al Viro
  2011-01-16 21:57       ` Sedat Dilek
  2011-01-16 23:06       ` Al Viro
  0 siblings, 2 replies; 8+ messages in thread
From: Al Viro @ 2011-01-16 21:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Joachim Eastwood, linux-kernel, linux-fsdevel

On Sun, Jan 16, 2011 at 01:37:54PM -0800, Linus Torvalds wrote:
> On Sun, Jan 16, 2011 at 1:15 PM, Joachim  Eastwood <manabian@gmail.com> wrote:
> >
> > f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting changes
> >
> > Breaks my ARM !CONFIG_SMP compile
> 
> In fact, any non-SMP compile, it's not ARM-specific.
> 
> The simple fix for the build breakage should be to just move the
> mnt_longterm thing out of the #ifdef CONFIG_SMP in
> include/linux/mount.h. But I do worry that it would cause some count
> imbalance, because there are some accesses that are still inside that
> CONFIG_SMP case in mntput_no_expire().
> 
> Al, please take a look,

Already fixed.  Actually, taking it out of ifdef would work (the only
place that actually cares about the value of that sucker is SMP side
of mntput()), but we are obviously better off just not touching it on
UP at all - why do pointless work and waste space?

See the patch upthread.  ->mnt_longterm is SMP-only optimization of
mntput(); it's there only to free the common case of mntput() from
cacheline bouncing and on UP it's needed at all.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:44     ` Al Viro
@ 2011-01-16 21:57       ` Sedat Dilek
  2011-01-16 23:06       ` Al Viro
  1 sibling, 0 replies; 8+ messages in thread
From: Sedat Dilek @ 2011-01-16 21:57 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, Joachim Eastwood, linux-kernel, linux-fsdevel

On Sun, Jan 16, 2011 at 10:44 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Sun, Jan 16, 2011 at 01:37:54PM -0800, Linus Torvalds wrote:
>> On Sun, Jan 16, 2011 at 1:15 PM, Joachim  Eastwood <manabian@gmail.com> wrote:
>> >
>> > f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting changes
>> >
>> > Breaks my ARM !CONFIG_SMP compile
>>
>> In fact, any non-SMP compile, it's not ARM-specific.
>>
>> The simple fix for the build breakage should be to just move the
>> mnt_longterm thing out of the #ifdef CONFIG_SMP in
>> include/linux/mount.h. But I do worry that it would cause some count
>> imbalance, because there are some accesses that are still inside that
>> CONFIG_SMP case in mntput_no_expire().
>>
>> Al, please take a look,
>
> Already fixed.  Actually, taking it out of ifdef would work (the only
> place that actually cares about the value of that sucker is SMP side
> of mntput()), but we are obviously better off just not touching it on
> UP at all - why do pointless work and waste space?
>
> See the patch upthread.  ->mnt_longterm is SMP-only optimization of
> mntput(); it's there only to free the common case of mntput() from
> cacheline bouncing and on UP it's needed at all.
>

You push "mnt_longterm is there only on SMP" patch also for "for-next"
GIT branch?

- Sedat -
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:36   ` Al Viro
@ 2011-01-16 22:05     ` Joachim Eastwood
  0 siblings, 0 replies; 8+ messages in thread
From: Joachim Eastwood @ 2011-01-16 22:05 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, linux-kernel, linux-fsdevel

On 1/16/11, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Sun, Jan 16, 2011 at 10:15:31PM +0100, Joachim Eastwood wrote:
>> Hi,
>>
>> On 1/16/11, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> > Al Viro (3):
>> >       sanitize vfsmount refcounting changes
>>
>> f03c65993b98eeb909a4012ce7833c5857d74755 - sanitize vfsmount refcounting
>> changes
>>
>> Breaks my ARM !CONFIG_SMP compile
>>
>>   CC      fs/namespace.o
>> fs/namespace.c: In function 'commit_tree':
>> fs/namespace.c:629: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c: In function 'umount_tree':
>> fs/namespace.c:1192: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c: In function 'mnt_make_longterm':
>> fs/namespace.c:2246: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c: In function 'mnt_make_shortterm':
>> fs/namespace.c:2251: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c:2254: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c: In function 'dup_mnt_ns':
>> fs/namespace.c:2295: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c:2299: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c:2305: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>> fs/namespace.c: In function 'create_mnt_ns':
>> fs/namespace.c:2351: error: 'struct vfsmount' has no member named
>> 'mnt_longterm'
>
> Aaaaargh... Brown paperbag time - all testing was on SMP boxen ;-/  The fix
> follows.  Linus, I've dropped that into for-linus in usual place
> (git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/), so if you
> prefer to pull it, it's there.
>
> commit 91ed228ab50daa7aca54faa8bf5208b97e3448b8
> Author: Al Viro <viro@zeniv.linux.org.uk>
> Date:   Sun Jan 16 16:32:11 2011 -0500
>
>     mnt_longterm is there only on SMP
>
>     Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Thanks,
The patch fixed it.

regards
Joachim Eastwood

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git pull] vfs pile 2 (automount work)
  2011-01-16 21:44     ` Al Viro
  2011-01-16 21:57       ` Sedat Dilek
@ 2011-01-16 23:06       ` Al Viro
  1 sibling, 0 replies; 8+ messages in thread
From: Al Viro @ 2011-01-16 23:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Joachim Eastwood, linux-kernel, linux-fsdevel

On Sun, Jan 16, 2011 at 09:44:26PM +0000, Al Viro wrote:

> Already fixed.  Actually, taking it out of ifdef would work (the only
> place that actually cares about the value of that sucker is SMP side
> of mntput()), but we are obviously better off just not touching it on
> UP at all - why do pointless work and waste space?
> 
> See the patch upthread.  ->mnt_longterm is SMP-only optimization of
> mntput(); it's there only to free the common case of mntput() from
> cacheline bouncing and on UP it's needed at all.

PS: the patch does survive UP beating.  Could you pull
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus ?
There's only one patch at the moment:

Al Viro (1):
      mnt_longterm is there only on SMP

 fs/namespace.c |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-16 23:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-16 18:57 [git pull] vfs pile 2 (automount work) Al Viro
2011-01-16 21:15 ` Joachim Eastwood
2011-01-16 21:36   ` Al Viro
2011-01-16 22:05     ` Joachim Eastwood
2011-01-16 21:37   ` Linus Torvalds
2011-01-16 21:44     ` Al Viro
2011-01-16 21:57       ` Sedat Dilek
2011-01-16 23:06       ` Al Viro

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).