[LU-8846] lfs_migrate() should try to unlink volatile file Created: 17/Nov/16 Updated: 17/Dec/16 Resolved: 17/Dec/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.10.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | John Hammond |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | lfs | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
lfs_migrate() bypasses llapi_create_volatile_idx() and creates a volatile file directly. (It does this because it needs to create the volatile file with a specific striping and llapi_create_volatile_idx() does not allow us to pass in striping.) It should do as llapi_create_volatile_idx() does and try to unlink the volatile file after opening it (in case volatile file creation is not supported). Or we could add O_LOV_DELAY_CREATE to the open flags and use llapi_create_volatile_idx() but then we would need a function to apply the striping described by a struct llapi_stripe_param to an open file handle. |
| Comments |
| Comment by Gerrit Updater [ 17/Nov/16 ] |
|
John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23842 |
| Comment by Robert Read (Inactive) [ 17/Nov/16 ] |
|
I'm curious, what is the situation where volatile files are not supported and we're doing lfs migrate? |
| Comment by Andreas Dilger [ 17/Nov/16 ] |
|
Robert, I think John is saying that it isn't possible to specify the file layout when creating a volatile file, so that it can't be used when restriping a file during migration. I'm thinking it makes sense to create a new API to allow specifying the layout for a volatile file. Probably passing O_LOV_DELAY_CREATE and setting the layout explicitly (within the same llapi_create_volatile_layout() function) would be most straight forward. I don't think the current patch is wrong, however, since it shouldn't leave files around if the volatile file create API isn't available. |
| Comment by Robert Read (Inactive) [ 17/Nov/16 ] |
|
The existing API already allows passing O_LOV_DELAY_CREATE), and the copytool uses this so it can set striping on the volatile file. But my question was based on the patch comment: "In lfs_migrate() try to unlink the volatile file in case the MDT does not support volatile file creation." |
| Comment by John Hammond [ 17/Nov/16 ] |
|
It's also totally conceivable that upstream reviewers will notice volatile file handling and decide that it's a security issue or something. |
| Comment by Robert Read (Inactive) [ 17/Nov/16 ] |
|
Ah, that's a good point. |
| Comment by Gerrit Updater [ 17/Dec/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/23842/ |
| Comment by Peter Jones [ 17/Dec/16 ] |
|
Landed for 2.10 |