From 17a4d5a915c40ffb8fd52c3ffeba3331696aa1e6 Mon Sep 17 00:00:00 2001 From: Sunil Mushran Date: Fri, 18 Apr 2008 10:23:53 -0700 Subject: [PATCH] --- yaml --- r: 95840 b: refs/heads/master c: bc535809c06ada210d89f5a43b335c68ecbb8e1b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/file.c | 4 ++++ trunk/fs/ocfs2/symlink.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 827f70bdbde1..37ccb167f333 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 95642e56647d84963428a1168baa8a73cb782ac3 +refs/heads/master: bc535809c06ada210d89f5a43b335c68ecbb8e1b diff --git a/trunk/fs/ocfs2/file.c b/trunk/fs/ocfs2/file.c index 9154c82d3258..57e0d30cde98 100644 --- a/trunk/fs/ocfs2/file.c +++ b/trunk/fs/ocfs2/file.c @@ -1048,6 +1048,10 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) mlog_entry("(0x%p, '%.*s')\n", dentry, 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) mlog(0, "mode change: %d\n", attr->ia_mode); if (attr->ia_valid & ATTR_UID) diff --git a/trunk/fs/ocfs2/symlink.c b/trunk/fs/ocfs2/symlink.c index 7134007ba22f..ba9dbb51d25b 100644 --- a/trunk/fs/ocfs2/symlink.c +++ b/trunk/fs/ocfs2/symlink.c @@ -167,9 +167,11 @@ const struct inode_operations ocfs2_symlink_inode_operations = { .readlink = page_readlink, .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, + .setattr = ocfs2_setattr, }; const struct inode_operations ocfs2_fast_symlink_inode_operations = { .readlink = ocfs2_readlink, .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, + .setattr = ocfs2_setattr, };