All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang AiHua <zhangaihua1@huawei.com>
To: linux-unionfs@vger.kernel.org
Subject: retry: [PATCH] ovl: fix inode in utimes_common on overlayfs.
Date: Tue, 9 Aug 2016 11:00:03 +0800	[thread overview]
Message-ID: <57A94733.8090502@huawei.com> (raw)
In-Reply-To: <1469779579-28423-1-git-send-email-zhangaihua1@huawei.com>




-------- 转发的消息 --------
主题: [PATCH] ovl: fix inode in utimes_common on overlayfs.
日期: Fri, 29 Jul 2016 16:06:19 +0800
发件人: zhangaihua1@huawei.com
收件人: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org
抄送: Aihua Zhang <zhangaihua1@huawei.com>

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


.

  reply	other threads:[~2016-08-09  3:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  8:06 [PATCH] ovl: fix inode in utimes_common on overlayfs zhangaihua1
2016-07-29  8:06 ` zhangaihua1
2016-08-09  3:00 ` Zhang AiHua [this message]
2016-08-10  8:01   ` retry: " Miklos Szeredi
2016-08-11  9:13     ` Zhang AiHua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57A94733.8090502@huawei.com \
    --to=zhangaihua1@huawei.com \
    --cc=linux-unionfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.