diff options
| -rw-r--r-- | fs/ecryptfs/inode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 2c19d362d2d4..4d4cc6a90cd5 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
| @@ -929,6 +929,12 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) | |||
| 929 | } | 929 | } |
| 930 | } | 930 | } |
| 931 | mutex_unlock(&crypt_stat->cs_mutex); | 931 | mutex_unlock(&crypt_stat->cs_mutex); |
| 932 | if (S_ISREG(inode->i_mode)) { | ||
| 933 | rc = filemap_write_and_wait(inode->i_mapping); | ||
| 934 | if (rc) | ||
| 935 | goto out; | ||
| 936 | fsstack_copy_attr_all(inode, lower_inode); | ||
| 937 | } | ||
| 932 | memcpy(&lower_ia, ia, sizeof(lower_ia)); | 938 | memcpy(&lower_ia, ia, sizeof(lower_ia)); |
| 933 | if (ia->ia_valid & ATTR_FILE) | 939 | if (ia->ia_valid & ATTR_FILE) |
| 934 | lower_ia.ia_file = ecryptfs_file_to_lower(ia->ia_file); | 940 | lower_ia.ia_file = ecryptfs_file_to_lower(ia->ia_file); |
