Displaying 20 results from an estimated 22 matches for "trans_lock".
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...,6 @@ struct transaction {
sem_t sem;
uint32_t early_err;
uint32_t err;
- struct transaction *next;
struct nbdkit_extents *extents;
};
@@ -73,9 +72,6 @@ struct handle {
int fds[2]; /* Pipe for kicking the reader thread */
bool readonly;
pthread_t reader;
-
- pthread_mutex_t trans_lock; /* Covers access to trans list */
- struct transaction *trans; /* List of pending transactions */
};
/* Connect to server via absolute name of Unix socket */
@@ -306,7 +302,6 @@ void *
nbdplug_reader (void *handle)
{
struct handle *h = handle;
- int r;
while (!nbd_aio_is_dead (h->...
2019 Jun 18
0
[nbdkit PATCH] Experiment: nbd: Use ppoll() instead of pipe-to-self
...ite (h->nbd);
- /* Check if we were kicked because a command was started */
- if (fds[1].revents & POLLIN && read (h->fds[0], &c, 1) != 1) {
- nbdkit_error ("failed to read pipe: %m");
- break;
- }
-
ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock);
trans = h->trans;
prev = &h->trans;
@@ -400,7 +419,6 @@ static struct transaction *
nbdplug_register (struct handle *h, int64_t cookie)
{
struct transaction *trans;
- char c = 0;
if (cookie == -1) {
nbdkit_error ("command failed: %s", nbd_get_error ())...
2019 Jul 01
3
[nbdkit PATCH 0/2] Use new libnbd _notify functions
I'm not observing any noticeable performance differences, but I'm
liking the diffstat. I can't push this patch until we release a new
libnbd version with the _notify API addition, but am posting it now
for playing with things.
Eric Blake (2):
nbd: Move transaction info from heap to stack
nbd: Use nbdkit aio_*_notify variants
plugins/nbd/nbd.c | 217
2017 Nov 21
6
[nbdkit PATCH v2 0/4] enable parallel nbd forwarding
With this, I am finally able to get the nbd plugin to do out-of-order
responses to the client. Once this series goes in, we should be
ready for Rich to cut a release.
Eric Blake (4):
nbd: Split reading into separate thread
nbd: Protect writes with mutex
nbd: Enable parallel handling
tests: Test parallel nbd behavior
plugins/nbd/nbd.c | 217
2019 May 25
1
[nbdkit PATCH] nbd: Rewrite thread passing to use semaphore rather than pipe
...,10 +156,8 @@ nbd_config_complete (void)
/* The per-transaction details */
struct transaction {
- union {
- uint64_t cookie;
- int fds[2];
- } u;
+ uint64_t cookie;
+ sem_t sem;
void *buf;
uint64_t offset;
uint32_t count;
@@ -182,6 +181,7 @@ struct handle {
pthread_mutex_t trans_lock; /* Covers access to all fields below */
struct transaction *trans;
+ uint64_t unique;
bool dead;
};
@@ -264,7 +264,7 @@ find_trans_by_cookie (struct handle *h, uint64_t cookie, bool remove)
ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock);
ptr = &h->trans;
while ((tr...
2012 Apr 26
7
[PATCH 2/4] Btrfs: fix deadlock on sb->s_umount when doing umount
The reason the deadlock is that:
Task Btrfs-cleaner
umount()
down_write(&s->s_umount)
sync_filesystem()
do auto-defragment and produce
lots of dirty pages
close_ctree()
wait for the end of
btrfs-cleaner
start_transaction
reserve space
shrink_delalloc()
writeback_inodes_sb_nr_if_idle()
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...ol extents;
+ struct nbd_handle *nbd;
+ int fd; /* Cache of nbd_aio_get_fd */
+ int fds[2]; /* Pipe for kicking the reader thread */
+ bool readonly;
pthread_t reader;
- /* Prevents concurrent threads from interleaving writes to server */
- pthread_mutex_t write_lock;
-
- pthread_mutex_t trans_lock; /* Covers access to all fields below */
- struct transaction *trans;
- uint64_t unique;
- bool dead;
+ pthread_mutex_t trans_lock; /* Covers access to trans list */
+ struct transaction *trans; /* List of pending transactions */
};
/* Connect to server via absolute name of Unix socket */
@...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...ol extents;
+ struct nbd_handle *nbd;
+ int fd; /* Cache of nbd_aio_get_fd */
+ int fds[2]; /* Pipe for kicking the reader thread */
+ bool readonly;
pthread_t reader;
- /* Prevents concurrent threads from interleaving writes to server */
- pthread_mutex_t write_lock;
-
- pthread_mutex_t trans_lock; /* Covers access to all fields below */
- struct transaction *trans;
- uint64_t unique;
- bool dead;
+ pthread_mutex_t trans_lock; /* Covers access to trans list */
+ struct transaction *trans; /* List of pending transactions */
};
/* Connect to server via absolute name of Unix socket */
@...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...*/
-struct handle {
- /* These fields are read-only once initialized */
- int fd;
- int flags;
- int64_t size;
- bool structured;
- bool extents;
- pthread_t reader;
-
- /* Prevents concurrent threads from interleaving writes to server */
- pthread_mutex_t write_lock;
-
- pthread_mutex_t trans_lock; /* Covers access to all fields below */
- struct transaction *trans;
- uint64_t unique;
- bool dead;
-};
-
-/* Connect to server via absolute name of Unix socket */
-static char *sockname;
-
-/* Connect to server via TCP socket */
-static const char *hostname;
-static const char *port;
-
-/* Hu...
2019 May 30
5
[nbdkit PATCH 0/4] Play with libnbd for nbdkit-add
Patch 1 played with an early draft of Rich's Fedora 30 libnbd package:
https://bugzilla.redhat.com/show_bug.cgi?id=1713767#c17
Note that comment 21 provides a newer package 0.1.1-1 with a different
API; and that libnbd has more unreleased API changes in the pipeline
(whether that will be called 0.2 or 0.1.2); so we'll have to tweak
things based on what is actually available in distros.
2019 Jun 02
5
[nbdkit PATCH v2 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.2-1 is now available in Fedora 29/30 updates-testing,
although it was not compiled against libxml2 so it lacks uri support
(I ended up testing patch 4 with a self-built libnbd).
Diffs since v1 - rebase to master, bump from libnbd 0.1 to 0.1.2, add
URI support, better timing results
Still not done - patch 5 needs associated tests
Eric Blake (5):
nbd: Check for libnbd
nbd:
2018 Nov 08
1
[nbdkit PATCH] nbd: Fix race during close
...0, 0, NULL);
shutdown (h->fd, SHUT_WR);
}
- close (h->fd);
if ((errno = pthread_join (h->reader, NULL)))
nbdkit_debug ("failed to join reader thread: %m");
+ close (h->fd);
pthread_mutex_destroy (&h->write_lock);
pthread_mutex_destroy (&h->trans_lock);
free (h);
--
2.17.2
2019 May 25
0
[nbdkit PATCH 2/2] nbd: Add shared=true parameter
...*/
+struct handle {
+ /* These fields are read-only once initialized */
+ int fd;
+ int flags;
+ int64_t size;
+ bool structured;
+ bool extents;
+ pthread_t reader;
+
+ /* Prevents concurrent threads from interleaving writes to server */
+ pthread_mutex_t write_lock;
+
+ pthread_mutex_t trans_lock; /* Covers access to all fields below */
+ struct transaction *trans;
+ uint64_t unique;
+ bool dead;
+};
+
/* Connect to server via absolute name of Unix socket */
static char *sockname;
@@ -73,9 +104,18 @@ static const char *export;
/* Number of retries */
static unsigned long retry;
+/*...
2019 Jun 12
8
[nbdkit PATCH v3 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.4-1 is now available in Fedora 29/30 updates testing.
Diffs since v2 - rebase to master, bump from libnbd 0.1.2 to 0.1.3+,
add tests to TLS usage which flushed out the need to turn relative
pathnames into absolute, doc tweaks
Now that the testsuite covers TLS and libnbd has been fixed to provide
the things I found lacking when developing v2, I'm leaning towards
pushing this on
2019 May 25
3
[RFC nbdkit PATCH 0/2] Add 'nbdkit nbd shared=1' mode
I got annoyed by qemu-nbd's default of only allowing a single
connection; combine that with nbdkit's nbd plugin, and even 'qemu-nbd
--list' of nbdkit counts as the single connection and immediately
hangs up. If we introduce a shared mode, then 'qemu-nbd --list' can
connect as many times as it wants without killing the original
qemu-nbd wrapped by nbdkit. But this in turn
2013 Mar 04
2
[PATCH 1/2] Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails
...ransaction_wait))
@@ -3907,8 +3907,6 @@ int btrfs_cleanup_transaction(struct btrfs_root *root)
btrfs_destroy_delayed_inodes(root);
btrfs_assert_delayed_root_empty(root);
- btrfs_destroy_pending_snapshots(t);
-
btrfs_destroy_delalloc_inodes(root);
spin_lock(&root->fs_info->trans_lock);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b908960..94c0e42 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -596,12 +596,8 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
ret = btrfs_commit_transaction(trans,
root->fs_info->exten...
2017 Dec 02
2
[PATCH nbdkit nbd] nbd: Unsuccessful attempt to fix memory leak.
Hi Eric,
There's a memory leak in the nbd client. The message (below) is not
very useful because somehow debuginfo is missing in the plugin.
However it's easily reproducible by doing:
make check-valgrind TESTS=test-nbd
I tried the attached patch to fix what I thought was the bug, but
sadly the fix doesn't work for me :-( So I guess something else is
going on, but it does look as
2019 Apr 29
0
[nbdkit PATCH 2/2] nbd: Support TCP socket
...service name to use (default 10809).\n" \
+ "export=<NAME> Export name to connect to (default \"\").\n" \
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
@@ -199,7 +239,7 @@ nbd_mark_dead (struct handle *h)
ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock);
if (!h->dead) {
nbdkit_debug ("permanent failure while talking to server %s: %m",
- sockname);
+ servname);
h->dead = true;
}
else if (!err)
@@ -861,6 +901,45 @@ nbd_connect_unix(struct handle *h)
return 0;
}
+/* Connect to...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...e int commit_cowonly_roots(struct btrfs_trans_handle *trans,
* a dirty root struct and adds it into the list of dead roots that need to
* be deleted
*/
-int btrfs_add_dead_root(struct btrfs_root *root)
+void btrfs_add_dead_root(struct btrfs_root *root)
{
spin_lock(&root->fs_info->trans_lock);
list_add(&root->root_list, &root->fs_info->dead_roots);
spin_unlock(&root->fs_info->trans_lock);
- return 0;
}
/*
@@ -1232,8 +1231,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
if (flush_on_commit || snap_pending) {
btrfs_start_del...
2019 Apr 29
3
[nbdkit PATCH 0/2] Let nbd plugin connect to TCP socket
Accepting only Unix sockets can be a bit limiting; let's be more flexible.
Eric Blake (2):
nbd: Refactor Unix socket connection
nbd: Support TCP socket
plugins/nbd/nbdkit-nbd-plugin.pod | 36 ++++--
plugins/nbd/nbd.c | 175 ++++++++++++++++++++++--------
TODO | 3 -
3 files changed, 161 insertions(+), 53 deletions(-)
--
2.20.1