|
@@ -902,8 +902,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
|
|
mutex_lock(&crypt_stat->cs_mutex);
|
|
mutex_lock(&crypt_stat->cs_mutex);
|
|
if (S_ISDIR(dentry->d_inode->i_mode))
|
|
if (S_ISDIR(dentry->d_inode->i_mode))
|
|
crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
|
|
crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
|
|
- else if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)
|
|
|
|
- || !(crypt_stat->flags & ECRYPTFS_KEY_VALID)) {
|
|
|
|
|
|
+ else if (S_ISREG(dentry->d_inode->i_mode)
|
|
|
|
+ && (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)
|
|
|
|
+ || !(crypt_stat->flags & ECRYPTFS_KEY_VALID))) {
|
|
struct vfsmount *lower_mnt;
|
|
struct vfsmount *lower_mnt;
|
|
struct file *lower_file = NULL;
|
|
struct file *lower_file = NULL;
|
|
struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
|
|
struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
|