diff options
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index e77a2ec71aa5..0a50942b4378 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -902,8 +902,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) | |||
902 | mutex_lock(&crypt_stat->cs_mutex); | 902 | mutex_lock(&crypt_stat->cs_mutex); |
903 | if (S_ISDIR(dentry->d_inode->i_mode)) | 903 | if (S_ISDIR(dentry->d_inode->i_mode)) |
904 | crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); | 904 | crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); |
905 | else if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) | 905 | else if (S_ISREG(dentry->d_inode->i_mode) |
906 | || !(crypt_stat->flags & ECRYPTFS_KEY_VALID)) { | 906 | && (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) |
907 | || !(crypt_stat->flags & ECRYPTFS_KEY_VALID))) { | ||
907 | struct vfsmount *lower_mnt; | 908 | struct vfsmount *lower_mnt; |
908 | struct file *lower_file = NULL; | 909 | struct file *lower_file = NULL; |
909 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 910 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |