[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110803221707.GM2203@ZenIV.linux.org.uk>
Date: Wed, 3 Aug 2011 23:17:07 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
jack@...e.cz, hch@...radead.org, akpm@...ux-foundation.org,
toshi.okajima@...fujitsu.com, mszeredi@...e.cz
Subject: Re: [PATCH 2/4] vfs: keep list of mounts for each superblock
On Wed, Aug 03, 2011 at 12:48:39PM +0200, Miklos Szeredi wrote:
> @@ -696,6 +696,11 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
> mnt->mnt_sb = root->d_sb;
> mnt->mnt_mountpoint = mnt->mnt_root;
> mnt->mnt_parent = mnt;
> +
> + br_write_lock(vfsmount_lock);
> + list_add_tail(&mnt->mnt_instance, &mnt->mnt_sb->s_mounts);
> + br_write_unlock(vfsmount_lock);
Racy.
> @@ -745,6 +750,10 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
> if (!list_empty(&old->mnt_expire))
> list_add(&mnt->mnt_expire, &old->mnt_expire);
> }
> +
> + br_write_lock(vfsmount_lock);
> + list_add_tail(&mnt->mnt_instance, &mnt->mnt_sb->s_mounts);
> + br_write_unlock(vfsmount_lock);
Ditto. If you expect to be able to find *all* vfsmounts over given sb,
this locking is simply wrong.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists