Update ctime when changing the file's permission by setfacl
Jan Kara
reviewercover Update ctime when changing the file's permission by setfacl
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
Jan Kara
reviewerPATCH 1/4 ext2: update ctime when changing the file's permission by setfacl
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 <[email protected]>.
--- fs/ext2/acl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ext2/acl.c +1 -0
@@ -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 ;
Signature · 1 line
1.6.4.2
Jan Kara
reviewerPATCH 2/4 vfs: update ctime when changing the file's permission by setfacl
In reply to Jan Karageneric_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 <[email protected]>.
--- fs/generic_acl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/generic_acl.c +1 -0
@@ -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 ;
Signature · 1 line
1.6.4.2
Jan Kara
reviewerPATCH 3/4 ext4: update ctime when changing the file's permission by setfacl
In reply to Jan Karaext4 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 <[email protected]>.
--- fs/ext4/acl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ext4/acl.c +1 -0
@@ -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 ;
Signature · 1 line
1.6.4.2
[email protected]
maintainerRe: [PATCH 3/4] ext4: update ctime when changing the file's permission by setfacl
Quoted 1 line · Jan Kara
ext4 didn't update the ctime of the file when its permission was changed.
I've added this to the ext4 tree, thanks.
- Ted
Jan Kara
reviewerPATCH 4/4 jffs2: update ctime when changing the file's permission by setfacl
In reply to Jan Karajffs2 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 <[email protected]>.
--- fs/jffs2/acl.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
fs/jffs2/acl.c +2 -1
@@ -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;
Signature · 1 line
1.6.4.2
David Woodhouse
maintainerRe: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
Quoted 1 line · Jan Kara
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.
Signature · 2 lines
David Woodhouse Open Source Technology Centre [email protected] Intel Corporation
Al Viro
maintainerRe: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
Quoted 6 lines · David Woodhouse
Quoted 1 line · Jan Kara
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...
Al Viro
maintainerRe: [PATCH 4/4] jffs2: update ctime when changing the file's permission by setfacl
Quoted 10 lines · Al Viro
Quoted 6 lines · David Woodhouse
Quoted 1 line · Jan Kara
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... ;-/