qubes-linux-kernel/patches.fixes/novfs-truncate-fix
2010-07-07 13:12:45 +02:00

59 lines
1.6 KiB
Plaintext

From: Sankar P <psankar@novell.com>
Subject: novfs: Fixes corruption of OO documents on NSS Volumes
References: bnc#508259
Patch-mainline: no
OpenOffice documents stored in NSS volumes, when accessed
via NOVFS, get corrupted while using the ftruncate64 call.
Removed stale code which unsets the size in the setattr call.
Signed-off-by: Sankar P <psankar@novell.com>
Acked-by: Jan Kara <jack@suse.cz>
---
fs/novfs/inode.c | 25 -------------------------
1 file changed, 25 deletions(-)
--- a/fs/novfs/inode.c
+++ b/fs/novfs/inode.c
@@ -3183,7 +3183,6 @@ int novfs_i_setattr(struct dentry *dentr
unsigned int ia_valid = attr->ia_valid;
struct novfs_schandle session;
int retVal = 0;
- struct iattr mattr;
if (IS_ROOT(dentry) || /* Root */
IS_ROOT(dentry->d_parent) || /* User */
@@ -3241,30 +3240,6 @@ int novfs_i_setattr(struct dentry *dentr
attr->ia_size,
atime_buf, mtime_buf, ctime_buf);
- if ((attr->ia_valid & ATTR_FILE)
- && (attr->ia_valid & ATTR_SIZE)) {
- memcpy(&mattr, attr, sizeof(mattr));
- mattr.ia_valid &=
- ~(ATTR_FILE | ATTR_SIZE);
- attr = &mattr;
- ia_valid = attr->ia_valid;
-#if 0 // thanks to vfs changes in our tree...
- retVal =
- novfs_trunc_ex(attr->
- ia_file->
- private_data,
- attr->
- ia_size,
- session);
- if (!retVal) {
- inode->i_size = attr->ia_size;
- ((struct inode_data *) inode->
- i_private)->Flags |=
- UPDATE_INODE;
- }
-#endif
- }
-
if (ia_valid
&& !(retVal =
novfs_set_attr(path, attr, session))) {