[LU-14301] EOPNOTSUPP, ENOTSUPP, ENOTSUP confusion Created: 06/Jan/21 Updated: 14/Jul/23 Resolved: 12/Jan/21 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.14.0, Lustre 2.16.0, Lustre 2.15.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | John Hammond |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
llmv tries posix_fallocate() and falls back to ftruncate() if it indicates that the operation is not supported. From llvm-project-llvmorg-11.0.0/llvm/lib/Support/Unix/Path.inc: std::error_code resize_file(int FD, uint64_t Size) { #if defined(HAVE_POSIX_FALLOCATE) // If we have posix_fallocate use it. Unlike ftruncate it always allocates // space, so we get an error if the disk is full. if (int Err = ::posix_fallocate(FD, 0, Size)) { #ifdef _AIX constexpr int NotSupportedError = ENOTSUP; #else constexpr int NotSupportedError = EOPNOTSUPP; #endif if (Err != EINVAL && Err != NotSupportedError) return std::error_code(Err, std::generic_category()); } #endif // Use ftruncate as a fallback. It may or may not allocate space. At least on // OS X with HFS+ it does. if (::ftruncate(FD, Size) == -1) return std::error_code(errno, std::generic_category()); return std::error_code(); } Somewhere on the server side OST_FALLOCATE is failing and we are returning ENOTSUPP but we should be returning EOPNOTSUPP. Note: ENOTSUPP is 524 and defined only in the kernel errno.h and is a NFSv3 specific errno. EOPNOTSUPP (95) is defined in kernel and userspace errno.h. ENOTSUP is defined in userspace errno.h as an alias for EOPNOTSUPP. Ideally we should change every ENOTSUPP to EOPNOTSUPP and add a checkpatch warning. (Or almost every if there's some real NFSv3 interaction.) |
| Comments |
| Comment by Gerrit Updater [ 06/Jan/21 ] |
|
John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41148 |
| Comment by Gerrit Updater [ 12/Jan/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41148/ |
| Comment by Peter Jones [ 12/Jan/21 ] |
|
Landed for 2.14 |
| Comment by Gerrit Updater [ 20/Jan/21 ] |
|
John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41280 |
| Comment by Gerrit Updater [ 26/Feb/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41280/ |
| Comment by Mahmoud Hanafi [ 21/Apr/22 ] |
|
Is there a back port to 2.12. ? |
| Comment by Gerrit Updater [ 30/Jun/23 ] |
|
"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51511 |
| Comment by Gerrit Updater [ 14/Jul/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51511/ |