.. | .. |
---|
215 | 215 | value, size, xattr_flags); |
---|
216 | 216 | |
---|
217 | 217 | kfree(value); |
---|
218 | | - if (!error) { |
---|
| 218 | + if (!error) |
---|
219 | 219 | set_cached_acl(inode, type, acl); |
---|
220 | | - } |
---|
221 | 220 | |
---|
222 | 221 | return error; |
---|
223 | 222 | } |
---|
.. | .. |
---|
248 | 247 | error = posix_acl_update_mode(inode, &mode, &acl); |
---|
249 | 248 | if (error) |
---|
250 | 249 | goto out_stop; |
---|
251 | | - update_mode = 1; |
---|
| 250 | + if (mode != inode->i_mode) |
---|
| 251 | + update_mode = 1; |
---|
252 | 252 | } |
---|
253 | 253 | |
---|
254 | 254 | error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */); |
---|
255 | 255 | if (!error && update_mode) { |
---|
256 | 256 | inode->i_mode = mode; |
---|
257 | 257 | inode->i_ctime = current_time(inode); |
---|
258 | | - ext4_mark_inode_dirty(handle, inode); |
---|
| 258 | + error = ext4_mark_inode_dirty(handle, inode); |
---|
259 | 259 | } |
---|
260 | 260 | out_stop: |
---|
261 | 261 | ext4_journal_stop(handle); |
---|
.. | .. |
---|
284 | 284 | error = __ext4_set_acl(handle, inode, ACL_TYPE_DEFAULT, |
---|
285 | 285 | default_acl, XATTR_CREATE); |
---|
286 | 286 | posix_acl_release(default_acl); |
---|
| 287 | + } else { |
---|
| 288 | + inode->i_default_acl = NULL; |
---|
287 | 289 | } |
---|
288 | 290 | if (acl) { |
---|
289 | 291 | if (!error) |
---|
290 | 292 | error = __ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, |
---|
291 | 293 | acl, XATTR_CREATE); |
---|
292 | 294 | posix_acl_release(acl); |
---|
| 295 | + } else { |
---|
| 296 | + inode->i_acl = NULL; |
---|
293 | 297 | } |
---|
294 | 298 | return error; |
---|
295 | 299 | } |
---|