Skip to contentSkip to conversation

ocfs2: Update VFS inode's id info after reflink.

PATCH New Tao Ma 4 participants 4 messages Apr 21, 2010 – Apr 23, 2010 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: Update VFS inode's id info after reflink.

In reflink we update the id info in the disk but forget to update the corresponding information in the VFS inode. So update them accordingly in case we want to preserve the attributes.

---
 fs/ocfs2/refcounttree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/refcounttree.c +3 -0
index 8ae65c9..a8e8572 100644
@@ -4083,6 +4083,9 @@ static int ocfs2_complete_reflink(struct inode *s_inode,
 	di->i_attr = s_di->i_attr;
 
 	if (preserve) {
+		t_inode->i_uid = s_inode->i_uid;
+		t_inode->i_gid = s_inode->i_gid;
+		t_inode->i_mode = s_inode->i_mode;
 		di->i_uid = s_di->i_uid;
 		di->i_gid = s_di->i_gid;
 		di->i_mode = s_di->i_mode;
Signature · 1 line
1.6.3.3.334.g916e1.dirty
#1 lore raw

PATCH 1/1 ocfs2: Update VFS inode's id info after reflink.

Quoted 15 lines · Tao Ma

In reflink we update the id info in the disk but forget to update the corresponding information in the VFS inode. So update them accordingly in case we want to preserve the attributes.

---
 fs/ocfs2/refcounttree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/refcounttree.c +0 -0
index 8ae65c9..a8e8572 100644

fs/ocfs2/refcounttree.c static int ocfs2_complete_reflink(struct inode *s_inode, · line 4091

Quoted 9 lines
fs/ocfs2/refcounttree.c +3 -0
@@ -4083,6 +4083,9 @@ static int ocfs2_complete_reflink(struct inode *s_inode,
 	di->i_attr = s_di->i_attr;
 
 	if (preserve) {
+		t_inode->i_uid = s_inode->i_uid;
+		t_inode->i_gid = s_inode->i_gid;
+		t_inode->i_mode = s_inode->i_mode;
 		di->i_uid = s_di->i_uid;
 		di->i_gid = s_di->i_gid;
 		di->i_mode = s_di->i_mode;

Looks reasonable to me.

	--Mark

--
Mark Fasheh

#2 lore raw

PATCH 1/1 ocfs2: Update VFS inode's id info after reflink.

I have just verified this patch, it works fine for me.

Thanks,
-Jeff

Quoted 39 lines · Mark Fasheh
Quoted 15 lines · Tao Ma

In reflink we update the id info in the disk but forget to update the corresponding information in the VFS inode. So update them accordingly in case we want to preserve the attributes.

---
 fs/ocfs2/refcounttree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/refcounttree.c +0 -0
index 8ae65c9..a8e8572 100644

fs/ocfs2/refcounttree.c static int ocfs2_complete_reflink(struct inode *s_inode, · line 4091

Quoted 9 lines
fs/ocfs2/refcounttree.c +3 -0
@@ -4083,6 +4083,9 @@ static int ocfs2_complete_reflink(struct inode *s_inode,
 	di->i_attr = s_di->i_attr;
 
 	if (preserve) {
+		t_inode->i_uid = s_inode->i_uid;
+		t_inode->i_gid = s_inode->i_gid;
+		t_inode->i_mode = s_inode->i_mode;
 		di->i_uid = s_di->i_uid;
 		di->i_gid = s_di->i_gid;
 		di->i_mode = s_di->i_mode;

Looks reasonable to me.

	--Mark

--
Mark Fasheh

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

#3 lore raw

PATCH 1/1 ocfs2: Update VFS inode's id info after reflink.

In reply to Tao Ma
Quoted 6 lines · Tao Ma

In reflink we update the id info in the disk but forget to update the corresponding information in the VFS inode. So update them accordingly in case we want to preserve the attributes.

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

Joel

Signature · 8 lines
"Here's a nickle -- get yourself a better X server."
	- Keith Packard

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