linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Update ctime when changing the file's permission by setfacl
@ 2010-06-04 15:07 Jan Kara
  2010-06-04 15:07 ` [PATCH 1/4] ext2: update " Jan Kara
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jan Kara @ 2010-06-04 15:07 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: David Woodhouse, Al Viro, Theodore Ts'o, linux-ext4

  Hi,

  I went through filesystems in fs/ supporting acl's and checked which could
have the same issue as ext3. In the end I've ended up with just these four
patches. I'll take care of merging the ext2-bit and I'm sending it just for
completeness / review. The other patches should probably go through respective
maintainers...

									Honza


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] ext2: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 [PATCH 0/4] Update ctime when changing the file's permission by setfacl Jan Kara
@ 2010-06-04 15:07 ` Jan Kara
  2010-06-04 15:07 ` [PATCH 2/4] vfs: " Jan Kara
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Jan Kara @ 2010-06-04 15:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: David Woodhouse, Al Viro, Theodore Ts'o, linux-ext4, Jan Kara

ext2 didn't update the ctime of the file when its permission was changed.

Steps to reproduce:
 # touch aaa
 # stat -c %Z aaa
 1275289822
 # setfacl -m  'u::x,g::x,o::x' aaa
 # stat -c %Z aaa
 1275289822                         <- unchanged

But, according to the spec of the ctime, ext2 must update it.

Port of ext3 patch by Miao Xie <miaox@cn.fujitsu.com>.

CC: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext2/acl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index ca7e2a0..2bcc043 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -200,6 +200,7 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 					return error;
 				else {
 					inode->i_mode = mode;
+					inode->i_ctime = CURRENT_TIME_SEC;
 					mark_inode_dirty(inode);
 					if (error == 0)
 						acl = NULL;
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] vfs: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 [PATCH 0/4] Update ctime when changing the file's permission by setfacl Jan Kara
  2010-06-04 15:07 ` [PATCH 1/4] ext2: update " Jan Kara
@ 2010-06-04 15:07 ` Jan Kara
  2010-06-04 15:07 ` [PATCH 3/4] ext4: " Jan Kara
  2010-06-04 15:07 ` [PATCH 4/4] jffs2: " Jan Kara
  3 siblings, 0 replies; 9+ messages in thread
From: Jan Kara @ 2010-06-04 15:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: David Woodhouse, Al Viro, Theodore Ts'o, linux-ext4, Jan Kara

generic_acl_set didn't update the ctime of the file when its permission was
changed.

Steps to reproduce:
 # touch aaa
 # stat -c %Z aaa
 1275289822
 # setfacl -m  'u::x,g::x,o::x' aaa
 # stat -c %Z aaa
 1275289822                         <- unchanged

But, according to the spec of the ctime, vfs must update it.

Port of ext3 patch by Miao Xie <miaox@cn.fujitsu.com>.

CC: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/generic_acl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/generic_acl.c b/fs/generic_acl.c
index 99800e5..6bc9e3a 100644
--- a/fs/generic_acl.c
+++ b/fs/generic_acl.c
@@ -94,6 +94,7 @@ generic_acl_set(struct dentry *dentry, const char *name, const void *value,
 			if (error < 0)
 				goto failed;
 			inode->i_mode = mode;
+			inode->i_ctime = CURRENT_TIME;
 			if (error == 0) {
 				posix_acl_release(acl);
 				acl = NULL;
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ext4: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 [PATCH 0/4] Update ctime when changing the file's permission by setfacl Jan Kara
  2010-06-04 15:07 ` [PATCH 1/4] ext2: update " Jan Kara
  2010-06-04 15:07 ` [PATCH 2/4] vfs: " Jan Kara
@ 2010-06-04 15:07 ` Jan Kara
  2010-06-15 16:21   ` tytso
  2010-06-04 15:07 ` [PATCH 4/4] jffs2: " Jan Kara
  3 siblings, 1 reply; 9+ messages in thread
From: Jan Kara @ 2010-06-04 15:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: David Woodhouse, Al Viro, Theodore Ts'o, linux-ext4, Jan Kara

ext4 didn't update the ctime of the file when its permission was changed.

Steps to reproduce:
 # touch aaa
 # stat -c %Z aaa
 1275289822
 # setfacl -m  'u::x,g::x,o::x' aaa
 # stat -c %Z aaa
 1275289822                         <- unchanged

But, according to the spec of the ctime, ext4 must update it.

Port of ext3 patch by Miao Xie <miaox@cn.fujitsu.com>.

CC: linux-ext4@vger.kernel.org
CC: tytso@mit.edu
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/acl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index feaf498..5e2ed45 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -204,6 +204,7 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
 				return error;
 			else {
 				inode->i_mode = mode;
+				inode->i_ctime = ext4_current_time(inode);
 				ext4_mark_inode_dirty(handle, inode);
 				if (error == 0)
 					acl = NULL;
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 [PATCH 0/4] Update ctime when changing the file's permission by setfacl Jan Kara
                   ` (2 preceding siblings ...)
  2010-06-04 15:07 ` [PATCH 3/4] ext4: " Jan Kara
@ 2010-06-04 15:07 ` Jan Kara
  2010-06-04 15:14   ` David Woodhouse
  3 siblings, 1 reply; 9+ messages in thread
From: Jan Kara @ 2010-06-04 15:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: David Woodhouse, Al Viro, Theodore Ts'o, linux-ext4, Jan Kara

jffs2 didn't update the ctime of the file when its permission was changed.

Steps to reproduce:
 # touch aaa
 # stat -c %Z aaa
 1275289822
 # setfacl -m  'u::x,g::x,o::x' aaa
 # stat -c %Z aaa
 1275289822                         <- unchanged

But, according to the spec of the ctime, jffs2 must update it.

Port of ext3 patch by Miao Xie <miaox@cn.fujitsu.com>.

CC: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/jffs2/acl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index a33aab6..54a92fd 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -234,8 +234,9 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 			if (inode->i_mode != mode) {
 				struct iattr attr;
 
-				attr.ia_valid = ATTR_MODE;
+				attr.ia_valid = ATTR_MODE | ATTR_CTIME;
 				attr.ia_mode = mode;
+				attr.ia_ctime = CURRENT_TIME_SEC;
 				rc = jffs2_do_setattr(inode, &attr);
 				if (rc < 0)
 					return rc;
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 ` [PATCH 4/4] jffs2: " Jan Kara
@ 2010-06-04 15:14   ` David Woodhouse
  2010-06-04 18:32     ` Al Viro
  0 siblings, 1 reply; 9+ messages in thread
From: David Woodhouse @ 2010-06-04 15:14 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, Al Viro, Theodore Ts'o, linux-ext4

On Fri, 2010-06-04 at 17:07 +0200, Jan Kara wrote:
> jffs2 didn't update the ctime of the file when its permission was changed.

Thanks. I have a couple more JFFS2 bug fixes that Al pointed out a day
or two ago, which I want to submit for 2.6.35; I'll merge this through
my tree with those if that's OK.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
  2010-06-04 15:14   ` David Woodhouse
@ 2010-06-04 18:32     ` Al Viro
  2010-06-04 18:37       ` Al Viro
  0 siblings, 1 reply; 9+ messages in thread
From: Al Viro @ 2010-06-04 18:32 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Jan Kara, linux-fsdevel, Theodore Ts'o, linux-ext4

On Fri, Jun 04, 2010 at 04:14:02PM +0100, David Woodhouse wrote:
> On Fri, 2010-06-04 at 17:07 +0200, Jan Kara wrote:
> > jffs2 didn't update the ctime of the file when its permission was changed.
> 
> Thanks. I have a couple more JFFS2 bug fixes that Al pointed out a day
> or two ago, which I want to submit for 2.6.35; I'll merge this through
> my tree with those if that's OK.

How much else is currently in your tree?  I'm going to push to Linus in
a bit and I'd simply pull your tree first if that's all there is...

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
  2010-06-04 18:32     ` Al Viro
@ 2010-06-04 18:37       ` Al Viro
  0 siblings, 0 replies; 9+ messages in thread
From: Al Viro @ 2010-06-04 18:37 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Jan Kara, linux-fsdevel, Theodore Ts'o, linux-ext4

On Fri, Jun 04, 2010 at 07:32:46PM +0100, Al Viro wrote:
> On Fri, Jun 04, 2010 at 04:14:02PM +0100, David Woodhouse wrote:
> > On Fri, 2010-06-04 at 17:07 +0200, Jan Kara wrote:
> > > jffs2 didn't update the ctime of the file when its permission was changed.
> > 
> > Thanks. I have a couple more JFFS2 bug fixes that Al pointed out a day
> > or two ago, which I want to submit for 2.6.35; I'll merge this through
> > my tree with those if that's OK.
> 
> How much else is currently in your tree?  I'm going to push to Linus in
> a bit and I'd simply pull your tree first if that's all there is...

Hmm... several mtd patches too... ;-/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ext4: update ctime when changing the file's permission by setfacl
  2010-06-04 15:07 ` [PATCH 3/4] ext4: " Jan Kara
@ 2010-06-15 16:21   ` tytso
  0 siblings, 0 replies; 9+ messages in thread
From: tytso @ 2010-06-15 16:21 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, David Woodhouse, Al Viro, linux-ext4

On Fri, Jun 04, 2010 at 05:07:54PM +0200, Jan Kara wrote:
> ext4 didn't update the ctime of the file when its permission was changed.

I've added this to the ext4 tree, thanks.

						- Ted

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-06-15 16:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-04 15:07 [PATCH 0/4] Update ctime when changing the file's permission by setfacl Jan Kara
2010-06-04 15:07 ` [PATCH 1/4] ext2: update " Jan Kara
2010-06-04 15:07 ` [PATCH 2/4] vfs: " Jan Kara
2010-06-04 15:07 ` [PATCH 3/4] ext4: " Jan Kara
2010-06-15 16:21   ` tytso
2010-06-04 15:07 ` [PATCH 4/4] jffs2: " Jan Kara
2010-06-04 15:14   ` David Woodhouse
2010-06-04 18:32     ` Al Viro
2010-06-04 18:37       ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).