summaryrefslogtreecommitdiffstats
path: root/sys-utils/flock.c
diff options
context:
space:
mode:
authorKarel Zak2014-03-24 11:26:21 +0100
committerKarel Zak2014-03-24 11:26:21 +0100
commitcaf1ba11a367ad702fb774653daf9ebdcca49d7b (patch)
tree91e3728f62ef37ab351b11e457dbc7b21f75740d /sys-utils/flock.c
parentMerge branch 'fix-compile-color-cfdisk' of https://github.com/theonewolf/util... (diff)
downloadkernel-qcow2-util-linux-caf1ba11a367ad702fb774653daf9ebdcca49d7b.tar.gz
kernel-qcow2-util-linux-caf1ba11a367ad702fb774653daf9ebdcca49d7b.tar.xz
kernel-qcow2-util-linux-caf1ba11a367ad702fb774653daf9ebdcca49d7b.zip
flock: use nfs4 fallback on EBADF too
The kernel regression (probably v3.4, commit 55725513) introduces a new errno for O_RDONLY on NFS. Now it returns EBADF rather than EIO. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1078618 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/flock.c')
-rw-r--r--sys-utils/flock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 1a1091ded..f160eaca5 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -250,6 +250,7 @@ int main(int argc, char *argv[])
/* otherwise try again */
continue;
case EIO:
+ case EBADF: /* since Linux 3.4 (commit 55725513) */
/* Probably NFSv4 where flock() is emulated by fcntl().
* Let's try to reopen in read-write mode.
*/