Skip to contentSkip to conversation

ocfs2: update ctime when changing the file's permission by setfacl

PATCH New Tao Ma 2 participants 2 messages Sep 13, 2010 – Sep 23, 2010 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: update ctime when changing the file's permission by setfacl

In commit 30e2bab, ext3 fixed it. So change it accordingly in ocfs2.

Steps to reproduce:

# touch aaa
# stat -c %Z aaa
1283760364
# setfacl -m  'u::x,g::x,o::x' aaa
# stat -c %Z aaa
1283760364
---
 fs/ocfs2/acl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/acl.c +3 -0
index a76e0aa..3919150 100644
@@ -209,7 +209,10 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh,
 	}
 
 	inode->i_mode = new_mode;
+	inode->i_ctime = CURRENT_TIME;
 	di->i_mode = cpu_to_le16(inode->i_mode);
+	di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
+	di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
 
 	ocfs2_journal_dirty(handle, di_bh);
 
Signature · 1 line
1.7.1.GIT
#1 lore raw

PATCH 1/1 ocfs2: update ctime when changing the file's permission by setfacl

Quoted 11 lines · Tao Ma

In commit 30e2bab, ext3 fixed it. So change it accordingly in ocfs2.

Steps to reproduce:

# touch aaa
# stat -c %Z aaa
1283760364
# setfacl -m  'u::x,g::x,o::x' aaa
# stat -c %Z aaa
1283760364

This patch is now in the 'fixes' branch of ocfs2.git.

Joel

Signature · 10 lines
"I'm drifting and drifting
 Just like a ship out on the sea.
 Cause I ain't got nobody, baby,
 In this world to care for me."

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127