]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
flock: use nfs4 fallback on EBADF too
authorKarel Zak <kzak@redhat.com>
Mon, 24 Mar 2014 10:26:21 +0000 (11:26 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 24 Mar 2014 10:26:21 +0000 (11:26 +0100)
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>
sys-utils/flock.c

index 1a1091ded13709397dce67aa73e5b89b7e20d04d..f160eaca522dc3c9821095448b5a7972ffaad7cd 100644 (file)
@@ -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.
                         */