ocfs2: Allow uid/gid/perm changes of symlinks
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: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
This commit is contained in:
parent
95642e5664
commit
bc535809c0
|
@ -1048,6 +1048,10 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
|
||||||
mlog_entry("(0x%p, '%.*s')\n", dentry,
|
mlog_entry("(0x%p, '%.*s')\n", dentry,
|
||||||
dentry->d_name.len, dentry->d_name.name);
|
dentry->d_name.len, dentry->d_name.name);
|
||||||
|
|
||||||
|
/* 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)
|
if (attr->ia_valid & ATTR_MODE)
|
||||||
mlog(0, "mode change: %d\n", attr->ia_mode);
|
mlog(0, "mode change: %d\n", attr->ia_mode);
|
||||||
if (attr->ia_valid & ATTR_UID)
|
if (attr->ia_valid & ATTR_UID)
|
||||||
|
|
|
@ -167,9 +167,11 @@ const struct inode_operations ocfs2_symlink_inode_operations = {
|
||||||
.readlink = page_readlink,
|
.readlink = page_readlink,
|
||||||
.follow_link = ocfs2_follow_link,
|
.follow_link = ocfs2_follow_link,
|
||||||
.getattr = ocfs2_getattr,
|
.getattr = ocfs2_getattr,
|
||||||
|
.setattr = ocfs2_setattr,
|
||||||
};
|
};
|
||||||
const struct inode_operations ocfs2_fast_symlink_inode_operations = {
|
const struct inode_operations ocfs2_fast_symlink_inode_operations = {
|
||||||
.readlink = ocfs2_readlink,
|
.readlink = ocfs2_readlink,
|
||||||
.follow_link = ocfs2_follow_link,
|
.follow_link = ocfs2_follow_link,
|
||||||
.getattr = ocfs2_getattr,
|
.getattr = ocfs2_getattr,
|
||||||
|
.setattr = ocfs2_setattr,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue