[Ocfs2-commits] smushran commits r3096 - branches/ocfs2-1.2/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue May 6 13:33:32 PDT 2008


Author: smushran
Date: 2008-05-06 13:33:32 -0700 (Tue, 06 May 2008)
New Revision: 3096

Modified:
   branches/ocfs2-1.2/fs/ocfs2/file.c
   branches/ocfs2-1.2/fs/ocfs2/symlink.c
Log:
ocfs2: Allow uid/gid/perm changes of symlinks

Mainline commit bc535809c06ada210d89f5a43b335c68ecbb8e1b
Author: Sunil Mushran <sunil.mushran at oracle.com>
Date:   Fri Apr 18 10:23:53 2008 -0700

This patch adds the ability to change attributes of a symlink.
Fixes oss bugzilla#963
http://oss.oracle.com/bugzilla/show_bug.cgi?id=963

Signed-off-by: jlbec

Modified: branches/ocfs2-1.2/fs/ocfs2/file.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/file.c	2008-05-06 20:31:14 UTC (rev 3095)
+++ branches/ocfs2-1.2/fs/ocfs2/file.c	2008-05-06 20:33:32 UTC (rev 3096)
@@ -1085,6 +1085,10 @@
 	           dentry->d_name.len, dentry->d_name.name,
 		   OCFS2_I(inode)->ip_blkno);
 
+	/* ensuring we don't even attempt to truncate a symlink */
+	if (S_ISLNK(inode->i_mode))
+		attr->ia_valid &= ~ATTR_SIZE;
+
 	if (attr->ia_valid & ATTR_MODE)
 		mlog(0, "mode change: %d\n", attr->ia_mode);
 	if (attr->ia_valid & ATTR_UID)

Modified: branches/ocfs2-1.2/fs/ocfs2/symlink.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/symlink.c	2008-05-06 20:31:14 UTC (rev 3095)
+++ branches/ocfs2-1.2/fs/ocfs2/symlink.c	2008-05-06 20:33:32 UTC (rev 3096)
@@ -424,9 +424,11 @@
 	.readlink	= page_readlink,
 	.follow_link	= ocfs2_follow_link,
 	.getattr	= ocfs2_getattr,
+	.setattr	= ocfs2_setattr,
 };
 struct inode_operations ocfs2_fast_symlink_inode_operations = {
 	.readlink	= ocfs2_readlink,
 	.follow_link	= ocfs2_follow_link,
 	.getattr	= ocfs2_getattr,
+	.setattr	= ocfs2_setattr,
 };




More information about the Ocfs2-commits mailing list