[LU-7239] mdd_attr_set() synchronous when it need not be Created: 30/Sep/15 Updated: 23/Jan/19 Resolved: 23/Jan/19 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0, Lustre 2.5.4 |
| Fix Version/s: | Lustre 2.13.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Olaf Faaland | Assignee: | Hongchao Zhang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | llnl, patch, zfs | ||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
chmod() and friends are sometimes synchronous when they do not need to be. We encountered this with teams who use unix groups to allow shared file access. When rsync'ing (or extracting from tar, etc.) the creation of the directory tree on the destination was a series of mkdir() followed by fchownat() calls. A parent directory within the tree had S_ISGID set, and so after mkdir(child), the child also had S_ISGID set; but the subsequent fchownat(child, S_ISGID|some_mode) was forced to be synchronous by the current code. With regards to S_ISVTX | S_ISUID | S_ISGID, the current code causes mdt_attr_set() to be synchronous when any of those bits are set in the new mode, even if they were set already. The code should check differences between old and new modes, as it already does for bits in S_IRWXUGO. Some handling is also inconsistent with the intent of permission_needs_sync(), making the chmod operation synchronous when permissions are tightened on a directory. For S_ISUID, permissions are relaxed when the bit is set, in the sense that the user is allowed to create a file/directory owned by another user. So removing the bit is tightening restrictions. For S_ISGID, nothing is relaxed or tightened - the bit only takes effect if the user could have done the equivalent chown() anyway. So I believe this bit should not be considered at all. |
| Comments |
| Comment by Olaf Faaland [ 30/Sep/15 ] |
|
I will submit a patch for the changes described in the description. I also propose that the default value of the sync_permission flag be reversed. As mentioned in |
| Comment by Joseph Gmitter (Inactive) [ 30/Sep/15 ] |
|
Hi Bobijam, Can you take a look at the patch when it is submitted? Thanks. |
| Comment by Andreas Dilger [ 30/Sep/15 ] |
|
One factor that contributes significantly here is that TXG sync for ZFS is extremely slow (at most once per second). Conversely, this is basically a non-issue for ldiskfs MDTs. Improving the ZFS sync performance (via ZIL LU-4009) or having ZFS/osd-zfs actually start a sync on the TXG in dt_sync() rather than just calling txg_wait_synced(). |
| Comment by Gerrit Updater [ 01/Oct/15 ] |
|
Olaf Faaland-LLNL (faaland1@llnl.gov) uploaded a new patch: http://review.whamcloud.com/16699 |
| Comment by Christopher Morrone [ 01/Oct/15 ] |
|
Yes, of course the ZIL can make sync faster. Even better than having the ZIL for synchronous operations is not needing the ZIL in the first place. Alex talked about this sort of thing in his recent LAD'15 talk. This seems like an area where the choice to go synchronous is worth revisiting since the performance impact is significant. |
| Comment by Olaf Faaland [ 06/Nov/18 ] |
|
I notice also that https://jira.whamcloud.com/browse/LUDOC-180 is still open and sync_permission does not appear in the operations manual. |
| Comment by Gerrit Updater [ 23/Jan/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/16699/ |
| Comment by Peter Jones [ 23/Jan/19 ] |
|
Landed for 2.13 |