[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/26541] gold makes incorrect usage of fallocate in fallback pat
From: |
holger.berger at googlemail dot com |
Subject: |
[Bug gold/26541] gold makes incorrect usage of fallocate in fallback path |
Date: |
Fri, 19 Feb 2021 17:52:01 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=26541
--- Comment #3 from holger.berger at googlemail dot com ---
for me this patch works, but I think lustre should not leak it's internal error
code to teh client side, so the lustre part should probably not be part of an
official fix, and I think later versions of lustre fix that issue.
diff --git a/gold/output.cc b/gold/output.cc
index b7505ff..23a24ce 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -134,16 +134,17 @@ gold_fallocate(int o, off_t offset, off_t len)
if (parameters->options().posix_fallocate())
{
int err = ::posix_fallocate(o, offset, len);
- if (err != EINVAL && err != ENOSYS && err != EOPNOTSUPP)
+ if (err != EINVAL && err != ENOSYS && err != EOPNOTSUPP && err != 524 /*
LUSTRE_ENOTSUPP == 524 Operation is not supported */ )
return err;
}
#endif // defined(HAVE_POSIX_FALLOCATE)
#ifdef HAVE_FALLOCATE
{
+ errno = 0;
int err = ::fallocate(o, 0, offset, len);
- if (err != EINVAL && err != ENOSYS && err != EOPNOTSUPP)
- return err;
+ if (err == -1 && (errno != EINVAL && errno != ENOSYS && errno !=
EOPNOTSUPP && errno != 524 /* LUSTRE_ENOTSUPP == 524 Operation is not supported
*/ ))
+ return errno;
}
#endif // defined(HAVE_FALLOCATE)
--
You are receiving this mail because:
You are on the CC list for the bug.