From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: + r-o-bind-mounts-elevate-write-count-for-do_utimes.patch added to -mm tree Date: Mon, 12 Feb 2007 21:13:12 -0800 Message-ID: <200702130513.l1D5DCTJ022316@shell0.pdx.osdl.net> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from smtp.osdl.org ([65.172.181.24]:54880 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161068AbXBMFUF (ORCPT ); Tue, 13 Feb 2007 00:20:05 -0500 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: mm-commits@vger.kernel.org Cc: hansendc@us.ibm.com, haveblue@us.ibm.com, hch@lst.de, linuxram@us.ibm.com, miklos@szeredi.hu, viro@zeniv.linux.org.uk The patch titled r/o bind mounts: elevate write count for do_utimes() has been added to the -mm tree. Its filename is r-o-bind-mounts-elevate-write-count-for-do_utimes.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: r/o bind mounts: elevate write count for do_utimes() From: Dave Hansen Signed-off-by: Dave Hansen Cc: Miklos Szeredi Cc: Ram Pai Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/utimes.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff -puN fs/utimes.c~r-o-bind-mounts-elevate-write-count-for-do_utimes fs/utimes.c --- a/fs/utimes.c~r-o-bind-mounts-elevate-write-count-for-do_utimes +++ a/fs/utimes.c @@ -58,16 +58,19 @@ static long do_utimes_nsec(int dfd, char goto out; inode = nd.dentry->d_inode; + error = mnt_want_write(nd.mnt); + if (error) + goto dput_and_out; error = -EROFS; if (IS_RDONLY(inode)) - goto dput_and_out; + goto mnt_drop_write_and_out; /* Don't worry, the checks are done in inode_change_ok() */ newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME; if (times) { error = -EPERM; if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) - goto dput_and_out; + goto mnt_drop_write_and_out; newattrs.ia_atime = times[0]; newattrs.ia_mtime = times[1]; @@ -75,15 +78,17 @@ static long do_utimes_nsec(int dfd, char } else { error = -EACCES; if (IS_IMMUTABLE(inode)) - goto dput_and_out; + goto mnt_drop_write_and_out; if (current->fsuid != inode->i_uid && (error = vfs_permission(&nd, MAY_WRITE)) != 0) - goto dput_and_out; + goto mnt_drop_write_and_out; } mutex_lock(&inode->i_mutex); error = notify_change(nd.dentry, &newattrs); mutex_unlock(&inode->i_mutex); +mnt_drop_write_and_out: + mnt_drop_write(nd.mnt); dput_and_out: path_release(&nd); out: _ Patches currently in -mm which might be from hansendc@us.ibm.com are r-o-bind-mounts-filesystem-helpers-for-custom-struct-files.patch r-o-bind-mounts-add-vfsmount-writer-counts.patch r-o-bind-mounts-record-when-sb_writer_count-elevated-for-inode.patch r-o-bind-mounts-elevate-writer-count-for-chown-and-friends.patch r-o-bind-mounts-elevate-mnt-writers-for-callers-of-vfs_mkdir.patch r-o-bind-mounts-elevate-write-count-during-entire-ncp_ioctl.patch r-o-bind-mounts-elevate-write-count-for-link-and-symlink-calls.patch r-o-bind-mounts-elevate-mount-count-for-extended-attributes.patch r-o-bind-mounts-mount_is_safe-add-comment.patch r-o-bind-mounts-unix_find_other-elevate-write-count-for-touch_atime.patch r-o-bind-mounts-elevate-write-count-over-calls-to-vfs_rename.patch r-o-bind-mounts-elevate-write-count-files-are-opened.patch r-o-bind-mounts-elevate-writer-count-for-do_sys_truncate.patch r-o-bind-mounts-elevate-write-count-for-do_utimes.patch r-o-bind-mounts-elevate-write-count-for-do_sys_utime-and-touch_atime.patch r-o-bind-mounts-sys_mknodat-elevate-write-count-for-vfs_mknod-create.patch r-o-bind-mounts-elevate-mnt-writers-for-vfs_unlink-callers.patch r-o-bind-mounts-do_rmdir-elevate-write-count.patch r-o-bind-mounts-elevate-writer-count-for-custom-struct_file.patch r-o-bind-mounts-gfs-check-nlink-count.patch r-o-bind-mounts-honor-r-w-changes-at-do_remount-time.patch r-o-bind-mounts-kill-open-files-traverse-on-remount-ro.patch