diff options
-rw-r--r-- | fs/attr.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -159,17 +159,17 @@ int notify_change(struct dentry * dentry, struct iattr * attr) | |||
159 | if (!(attr->ia_valid & ~(ATTR_KILL_SUID | ATTR_KILL_SGID))) | 159 | if (!(attr->ia_valid & ~(ATTR_KILL_SUID | ATTR_KILL_SGID))) |
160 | return 0; | 160 | return 0; |
161 | 161 | ||
162 | error = security_inode_setattr(dentry, attr); | ||
163 | if (error) | ||
164 | return error; | ||
165 | |||
162 | if (ia_valid & ATTR_SIZE) | 166 | if (ia_valid & ATTR_SIZE) |
163 | down_write(&dentry->d_inode->i_alloc_sem); | 167 | down_write(&dentry->d_inode->i_alloc_sem); |
164 | 168 | ||
165 | if (inode->i_op && inode->i_op->setattr) { | 169 | if (inode->i_op && inode->i_op->setattr) { |
166 | error = security_inode_setattr(dentry, attr); | 170 | error = inode->i_op->setattr(dentry, attr); |
167 | if (!error) | ||
168 | error = inode->i_op->setattr(dentry, attr); | ||
169 | } else { | 171 | } else { |
170 | error = inode_change_ok(inode, attr); | 172 | error = inode_change_ok(inode, attr); |
171 | if (!error) | ||
172 | error = security_inode_setattr(dentry, attr); | ||
173 | if (!error) { | 173 | if (!error) { |
174 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 174 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
175 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) | 175 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) |