Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452303 > unrolled thread

[PATCH] ovl: fix inode in utimes_common on overlayfs.

Started by<zhangaihua1@huawei.com>
First post2016-07-29 10:10 +0200
Last post2016-07-29 10:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ovl: fix inode in utimes_common on overlayfs. <zhangaihua1@huawei.com> - 2016-07-29 10:10 +0200

#1452303 — [PATCH] ovl: fix inode in utimes_common on overlayfs.

From<zhangaihua1@huawei.com>
Date2016-07-29 10:10 +0200
Subject[PATCH] ovl: fix inode in utimes_common on overlayfs.
Message-ID<s0b1M-20c-23@gated-at.bofh.it>
From: Aihua Zhang <zhangaihua1@huawei.com>

the check IS_IMMUTABLE(inode) is invalid in utimes_commmon,
the inode should point to upper rather than merge.

the patch also fix the error in LTP(utimensat01).

Signed-off-by: Aihua Zhang <zhangaihua1@huawei.com>
---
 fs/utimes.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/utimes.c b/fs/utimes.c
index 85c40f4..1813a62 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -53,6 +53,7 @@ static int utimes_common(struct path *path, struct timespec *times)
 	int error;
 	struct iattr newattrs;
 	struct inode *inode = path->dentry->d_inode;
+	struct inode *real_inode = d_real(path->dentry)->d_inode;
 	struct inode *delegated_inode = NULL;
 
 	error = mnt_want_write(path->mnt);
@@ -93,7 +94,7 @@ static int utimes_common(struct path *path, struct timespec *times)
 		 * inode_change_ok() won't do it.
 		 */
 		error = -EACCES;
-                if (IS_IMMUTABLE(inode))
+                if (IS_IMMUTABLE(real_inode))
 			goto mnt_drop_write_and_out;
 
 		if (!inode_owner_or_capable(inode)) {
-- 
1.7.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web