[LU-10681] Disable tiny writes for O_APPEND Created: 18/Feb/18 Updated: 13/Mar/18 Resolved: 08/Mar/18 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.11.0 |
| Fix Version/s: | Lustre 2.11.0 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Patrick Farrell (Inactive) | Assignee: | Patrick Farrell (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
Unfortunately, tiny writes will not work correctly with O_APPEND. In short, this is because O_APPEND depends on LDLM locking to EOF (on all stripes/components) to protect the file size, but tiny writes requires only that the page we are writing to be locked. This means the LDLM lock on a stripe not containing this page could be granted to another client and that client could extend the file without revoking our lock. The simplest example is in a multiple stripes situation, but it could happen in a single stripe situation. Client 1 writes to a page on stripe 1, dirtying it. File size is, for example, 2K. (not O_APPEND) Data is not in the correct location. Ouch. Two possible fixes: One further thought: I'll submit a patch. I will probably stick with the simplest solution - Don't do tiny writes for O_APPEND. I will explore the test locking option, but that may be a little complicated, and the more complicated the tiny writes code gets, the less benefit it has. Note this problem is likely to be hit in the real world because O_APPEND writes are very often small. |
| Comments |
| Comment by Gerrit Updater [ 20/Feb/18 ] |
|
Patrick Farrell (paf@cray.com) uploaded a new patch: https://review.whamcloud.com/31353 |
| Comment by Gerrit Updater [ 08/Mar/18 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31353/ |
| Comment by Peter Jones [ 08/Mar/18 ] |
|
Landed for 2.11 |
| Comment by Gerrit Updater [ 13/Mar/18 ] |
|
Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/31633 |