Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 598396 Details for
Bug 839294
tar --create fails to open file (with exit 2) when the kernel lease is established by Samba
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
try to open kernel-lease blocked file multiple times
tar-1.26-lease-blocked-file.patch (text/plain), 3.48 KB, created by
Pavel Raiskup
on 2012-07-16 08:53:06 UTC
(
hide
)
Description:
try to open kernel-lease blocked file multiple times
Filename:
MIME Type:
Creator:
Pavel Raiskup
Created:
2012-07-16 08:53:06 UTC
Size:
3.48 KB
patch
obsolete
>From a53b2ee4fd159b4789363c0dd66f85ad0161f3b6 Mon Sep 17 00:00:00 2001 >From: Pavel Raiskup <praiskup@redhat.com> >Date: Mon, 16 Jul 2012 10:37:17 +0200 >Subject: [PATCH] Try to open kernel-lease blocked file multiple times. > >--- > src/common.h | 7 +++++++ > src/create.c | 25 ++++++++++++++++++++++--- > src/tar.c | 26 ++++++++++++++++++++++++++ > 3 files changed, 55 insertions(+), 3 deletions(-) > >diff --git a/src/common.h b/src/common.h >index 439bf42..8dc7d6c 100644 >--- a/src/common.h >+++ b/src/common.h >@@ -304,6 +304,13 @@ GLOBAL const char *volno_file_option; > > /* Specified value or pattern. */ > GLOBAL const char *volume_label_option; >+ >+/* Wait period in microseconds */ >+GLOBAL int lease_period_option; >+#define DEF_LEASE_WAIT_PERIOD 10000 >+ >+/* Wait for lease to be unlocked at most max_wait_count_option times */ >+GLOBAL int lease_wait_count_option; > > /* Other global variables. */ > >diff --git a/src/create.c b/src/create.c >index 1fb7eba..7cfb5e1 100644 >--- a/src/create.c >+++ b/src/create.c >@@ -1564,6 +1564,7 @@ int > subfile_open (struct tar_stat_info const *dir, char const *file, int flags) > { > int fd; >+ int waited_count = 0; > > static bool initialized; > if (! initialized) >@@ -1577,9 +1578,27 @@ subfile_open (struct tar_stat_info const *dir, char const *file, int flags) > gettext (""); > } > >- while ((fd = openat (dir ? dir->fd : chdir_fd, file, flags)) < 0 >- && open_failure_recover (dir)) >- continue; >+ while ((fd = openat (dir ? dir->fd : chdir_fd, file, flags)) < 0) >+ { >+ if (open_failure_recover (dir)) >+ /* try to open this file again */ >+ continue; >+ >+ /* check whether there is a file lease set */ >+ if (lease_wait_count_option && errno == EWOULDBLOCK) >+ { >+ if (waited_count > lease_wait_count_option) >+ return -1; >+ >+ usleep(lease_period_option ? lease_period_option >+ : DEF_LEASE_WAIT_PERIOD); >+ waited_count ++; >+ continue; >+ } >+ >+ /* non recoverable */ >+ break; >+ } > return fd; > } > >diff --git a/src/tar.c b/src/tar.c >index 0669a01..4b270b4 100644 >--- a/src/tar.c >+++ b/src/tar.c >@@ -282,6 +282,8 @@ enum > IGNORE_FAILED_READ_OPTION, > INDEX_FILE_OPTION, > KEEP_NEWER_FILES_OPTION, >+ LEASE_COUNT_OPTION, >+ LEASE_PERIOD_OPTION, > LEVEL_OPTION, > LZIP_OPTION, > LZMA_OPTION, >@@ -447,6 +449,12 @@ static struct argp_option options[] = { > {"check-device", CHECK_DEVICE_OPTION, NULL, 0, > N_("check device numbers when creating incremental archives (default)"), > GRID+1 }, >+ {"lease-wait-count", LEASE_COUNT_OPTION, N_("COUNT"), 0, >+ N_("wait for file lease for at most COUNT periods"), >+ GRID+1 }, >+ {"lease-wait-period", LEASE_PERIOD_OPTION, N_("USECONDS"), 0, >+ N_("lease wait period in microseconds"), >+ GRID+1 }, > #undef GRID > > #define GRID 30 >@@ -2100,6 +2108,24 @@ parse_opt (int key, char *arg, struct argp_state *state) > same_permissions_option = -1; > break; > >+ case LEASE_COUNT_OPTION: >+ { >+ char *p; >+ lease_wait_count_option = strtoul (arg, &p, 10); >+ if (*p) >+ USAGE_ERROR ((0, 0, _("Invalid lease waiting count"))); >+ break; >+ } >+ >+ case LEASE_PERIOD_OPTION: >+ { >+ char *p; >+ lease_period_option = strtoul (arg, &p, 10); >+ if (*p) >+ USAGE_ERROR ((0, 0, _("Invalid lease waiting count"))); >+ break; >+ } >+ > case ACLS_OPTION: > set_archive_format ("posix"); > acls_option = 1; >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 839294
: 598396