From: Dave Hansen Elevate the write count during the vfs_rmdir() call. Acked-by: Serge Hallyn Acked-by: Al Viro Signed-off-by: Christoph Hellwig Signed-off-by: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Andrew Morton --- fs/namei.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN fs/namei.c~r-o-bind-mounts-elevate-write-count-for-vfs_rmdir fs/namei.c --- a/fs/namei.c~r-o-bind-mounts-elevate-write-count-for-vfs_rmdir +++ a/fs/namei.c @@ -2190,7 +2190,12 @@ static long do_rmdir(int dfd, const char error = PTR_ERR(dentry); if (IS_ERR(dentry)) goto exit2; + error = mnt_want_write(nd.path.mnt); + if (error) + goto exit3; error = vfs_rmdir(nd.path.dentry->d_inode, dentry); + mnt_drop_write(nd.path.mnt); +exit3: dput(dentry); exit2: mutex_unlock(&nd.path.dentry->d_inode->i_mutex); _