summaryrefslogtreecommitdiff
path: root/filesystems/glusterfs/patches
diff options
context:
space:
mode:
authormanu <manu@pkgsrc.org>2011-11-28 08:42:38 +0000
committermanu <manu@pkgsrc.org>2011-11-28 08:42:38 +0000
commit49f1bffa12628d9a230345aaf38807184677d4ba (patch)
tree17d64e4832be222100fe2dbe0779b27a4ec95b4a /filesystems/glusterfs/patches
parent6cc12c90a2c7b126a2c41cffd50c5f5283e5672e (diff)
downloadpkgsrc-49f1bffa12628d9a230345aaf38807184677d4ba.tar.gz
Update to glusterfs 3.2.5. This is a bug-fix release
Diffstat (limited to 'filesystems/glusterfs/patches')
-rw-r--r--filesystems/glusterfs/patches/patch-ae27
-rw-r--r--filesystems/glusterfs/patches/patch-ba45
-rw-r--r--filesystems/glusterfs/patches/patch-be10
-rw-r--r--filesystems/glusterfs/patches/patch-bq10
-rw-r--r--filesystems/glusterfs/patches/patch-br78
-rw-r--r--filesystems/glusterfs/patches/patch-bw2
-rw-r--r--filesystems/glusterfs/patches/patch-bx2
-rw-r--r--filesystems/glusterfs/patches/patch-by458
-rw-r--r--filesystems/glusterfs/patches/patch-bz24
9 files changed, 81 insertions, 575 deletions
diff --git a/filesystems/glusterfs/patches/patch-ae b/filesystems/glusterfs/patches/patch-ae
index 48889308ada..ad22ecba1de 100644
--- a/filesystems/glusterfs/patches/patch-ae
+++ b/filesystems/glusterfs/patches/patch-ae
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.9 2011/11/24 05:36:36 manu Exp $
+$NetBSD: patch-ae,v 1.10 2011/11/28 08:42:39 manu Exp $
On NetBSD use libperfuse(3), rename umount2(2) as unmount(2), and skip
inexistant /etc/mtab management.
@@ -7,8 +7,8 @@ Include <signal.h> for sigprocmask(2)
Use /sbin/mount on NetBSD, not /bin/mount
---- contrib/fuse-lib/mount.c.orig 2011-08-23 14:31:36.000000000 +0200
-+++ contrib/fuse-lib/mount.c 2011-11-24 03:31:11.000000000 +0100
+--- contrib/fuse-lib/mount.c.orig 2011-11-14 14:45:58.000000000 +0100
++++ contrib/fuse-lib/mount.c 2011-11-27 08:53:09.000000000 +0100
@@ -19,16 +19,30 @@
#include <limits.h>
#include <fcntl.h>
@@ -78,3 +78,24 @@ Use /sbin/mount on NetBSD, not /bin/mount
}
res = waitpid (res, &status, 0);
if (res == -1)
+@@ -562,8 +580,9 @@
+ goto out;
+ else
+ mounted = 1;
+
++#ifndef __NetBSD__
+ if (geteuid () == 0) {
+ char *newmnt = fuse_mnt_resolve_path ("fuse", mountpoint);
+
+ if (!newmnt) {
+@@ -580,8 +599,9 @@
+
+ goto out;
+ }
+ }
++#endif /* __NetBSD__ */
+
+ out:
+ if (ret == -1) {
+ if (mounted)
+
diff --git a/filesystems/glusterfs/patches/patch-ba b/filesystems/glusterfs/patches/patch-ba
deleted file mode 100644
index 99eff8c95e4..00000000000
--- a/filesystems/glusterfs/patches/patch-ba
+++ /dev/null
@@ -1,45 +0,0 @@
-$NetBSD: patch-ba,v 1.7 2011/09/18 01:36:06 manu Exp $
-
-glibc dirname() modify the string it is given and returns it.
-glusterfs takes this behavior for granted, and assume that if it
-gives a malloc'ed string to dirname(), then it can free()) the
-return value.
-
-Here is what SUSv2 says:
-http://opengroup.org/onlinepubs/007908799/xsh/dirname.html
-"The dirname() function may modify the string pointed to by path,
-and may return a pointer to static storage"
-
-At least NetBSD returns a static storage. glusterfs will return it to
-a calling function that has the responsability to free it, causing
-a SIGSEGV.
-
---- xlators/performance/stat-prefetch/src/stat-prefetch.c.orig 2011-08-23 14:31:41.000000000 +0200
-+++ xlators/performance/stat-prefetch/src/stat-prefetch.c 2011-09-17 15:45:29.000000000 +0200
-@@ -949,18 +949,24 @@
- path = dirname (cpy);
- switch (i)
- {
- case 0:
-- *parent = path;
-+ *parent = gf_strdup (path);
-+ if (*parent == NULL)
-+ goto out;
- break;
- case 1:
-- *grand_parent = path;
-+ *grand_parent = gf_strdup (path);
-+ if (*grand_parent == NULL)
-+ goto out;
- break;
- }
- }
-
- ret = 0;
- out:
-+ if (cpy != NULL)
-+ GF_FREE(cpy);
- return ret;
- }
-
-
diff --git a/filesystems/glusterfs/patches/patch-be b/filesystems/glusterfs/patches/patch-be
index 9cc4683b0a3..b1c0cf401cf 100644
--- a/filesystems/glusterfs/patches/patch-be
+++ b/filesystems/glusterfs/patches/patch-be
@@ -1,14 +1,14 @@
-$NetBSD: patch-be,v 1.6 2011/07/23 01:14:44 manu Exp $
+$NetBSD: patch-be,v 1.7 2011/11/28 08:42:39 manu Exp $
basename() and dirname() are not supposed to be thread-safe, and NetBSD's
implementation is not. glusterfs assume the functions are thread-safe.
Borrow basename() and rdirname() form glibc and make NetBSD use them.
---- libglusterfs/src/compat.c.orig 2011-07-14 14:21:10.000000000 +0200
-+++ libglusterfs/src/compat.c 2011-07-22 09:00:15.000000000 +0200
-@@ -529,8 +529,412 @@
+--- libglusterfs/src/compat.c.orig 2011-11-27 07:55:13.000000000 +0100
++++ libglusterfs/src/compat.c 2011-11-27 07:55:13.000000000 +0100
+@@ -550,8 +550,412 @@
+
- }
#endif /* GF_SOLARIS_HOST_OS */
+#ifdef __NetBSD__
diff --git a/filesystems/glusterfs/patches/patch-bq b/filesystems/glusterfs/patches/patch-bq
index 5daf8814ad3..2c165002e07 100644
--- a/filesystems/glusterfs/patches/patch-bq
+++ b/filesystems/glusterfs/patches/patch-bq
@@ -1,9 +1,9 @@
-$NetBSD: patch-bq,v 1.7 2011/10/06 02:19:06 manu Exp $
+$NetBSD: patch-bq,v 1.8 2011/11/28 08:42:39 manu Exp $
Make sure gluseterfsd listens on the same address family as glusterd
---- xlators/mgmt/glusterd/src/glusterd-utils.c.orig 2011-08-23 14:31:40.000000000 +0200
-+++ xlators/mgmt/glusterd/src/glusterd-utils.c 2011-09-17 15:45:30.000000000 +0200
+--- xlators/mgmt/glusterd/src/glusterd-utils.c.orig 2011-11-27 07:38:16.000000000 +0100
++++ xlators/mgmt/glusterd/src/glusterd-utils.c 2011-11-27 07:38:16.000000000 +0100
@@ -88,8 +88,52 @@
//TODO: set timestamp
return 0;
@@ -57,7 +57,7 @@ Make sure gluseterfsd listens on the same address family as glusterd
glusterd_is_loopback_localhost (const struct sockaddr *sa, char *hostname)
{
GF_ASSERT (sa);
-@@ -1030,8 +1074,10 @@
+@@ -1032,8 +1076,10 @@
int rdma_port = 0;
FILE *file = NULL;
gf_boolean_t is_locked = _gf_false;
@@ -68,7 +68,7 @@ Make sure gluseterfsd listens on the same address family as glusterd
GF_ASSERT (volinfo);
GF_ASSERT (brickinfo);
-@@ -1110,14 +1156,19 @@
+@@ -1112,14 +1158,19 @@
port = brickinfo->port;
if (!port)
port = pmap_registry_alloc (THIS);
diff --git a/filesystems/glusterfs/patches/patch-br b/filesystems/glusterfs/patches/patch-br
index 67dcb27f0e3..e8678cc17cd 100644
--- a/filesystems/glusterfs/patches/patch-br
+++ b/filesystems/glusterfs/patches/patch-br
@@ -1,4 +1,4 @@
-$NetBSD: patch-br,v 1.8 2011/10/30 05:07:15 manu Exp $
+$NetBSD: patch-br,v 1.9 2011/11/28 08:42:39 manu Exp $
Use linkat(2) if available so that we can make a hardlink to symlink
itself, instead of symlink destination, like link(2) does. This is
@@ -8,11 +8,10 @@ glusterfsd really wants to hardlink the symlink and not its target.
If linkat(2) is inavailable, then moving a symlink on distributed
volumes fails.
-Also pull upstreampatch that fix inode generation so that values
-are reliable
+Correctly cas gfid when producing inode to avoid it getting garbled
---- xlators/storage/posix/src/posix.c.orig 2011-08-23 14:31:42.000000000 +0200
-+++ xlators/storage/posix/src/posix.c 2011-10-28 14:59:13.000000000 +0200
+--- xlators/storage/posix/src/posix.c.orig 2011-11-14 14:46:03.000000000 +0100
++++ xlators/storage/posix/src/posix.c 2011-11-27 10:09:03.000000000 +0100
@@ -36,8 +36,12 @@
#ifndef GF_BSD_HOST_OS
#include <alloca.h>
@@ -26,53 +25,18 @@ are reliable
#include "md5.h"
#include "checksum.h"
#include "dict.h"
-@@ -244,8 +248,23 @@
+@@ -286,9 +290,9 @@
+ int i = 0;
- return ret;
- }
-
-+void
-+posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf)
-+{
-+ uint64_t temp_ino = 0;
-+ int j = 0;
-+ int i = 0;
-+
-+ /* consider least significant 8 bytes of value out of gfid */
-+ for (i = 15; i > (15 - 8); i--) {
+ /* consider least significant 8 bytes of value out of gfid */
+ for (i = 15; i > (15 - 8); i--) {
+- temp_ino += buf->ia_gfid[i] << j;
+ temp_ino += (uint64_t)(buf->ia_gfid[i]) << j;
-+ j += 8;
-+ }
-+
-+ buf->ia_ino = temp_ino;
-+}
-
- int
- posix_lstat_with_gfid (xlator_t *this, const char *path, struct iatt *stbuf_p)
- {
-@@ -265,8 +284,10 @@
- ret = posix_fill_gfid_path (this, path, &stbuf);
- if (ret)
- gf_log_callingfn (this->name, GF_LOG_DEBUG, "failed to get gfid");
-
-+ posix_fill_ino_from_gfid (this, &stbuf);
-+
- if (stbuf_p)
- *stbuf_p = stbuf;
- out:
- return ret;
-@@ -292,8 +313,10 @@
- ret = posix_fill_gfid_fd (this, fd, &stbuf);
- if (ret)
- gf_log_callingfn (this->name, GF_LOG_DEBUG, "failed to get gfid");
-
-+ posix_fill_ino_from_gfid (this, &stbuf);
-+
- if (stbuf_p)
- *stbuf_p = stbuf;
+ j += 8;
+ }
- out:
-@@ -1232,8 +1255,13 @@
+ buf->ia_ino = temp_ino;
+@@ -1311,8 +1315,13 @@
loc->path, strerror (op_errno));
goto out;
}
@@ -86,7 +50,7 @@ are reliable
if (op_ret == -1) {
op_errno = errno;
-@@ -2125,9 +2153,20 @@
+@@ -2204,9 +2213,20 @@
newparentpath, strerror (op_errno));
goto out;
}
@@ -107,23 +71,23 @@ are reliable
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
"link %s to %s failed: %s",
-@@ -4376,13 +4415,15 @@
+@@ -4455,14 +4475,15 @@
/* pick ENOENT to indicate EOF */
op_errno = errno;
-- if (whichop == GF_FOP_READDIRP) {
-- list_for_each_entry (tmp_entry, &entries.list, list) {
-- strcpy (entry_path + real_path_len + 1,
-- tmp_entry->d_name);
-- posix_lstat_with_gfid (this, entry_path, &stbuf);
+ list_for_each_entry (tmp_entry, &entries.list, list) {
+ strcpy (entry_path + real_path_len + 1,
+ tmp_entry->d_name);
+ posix_lstat_with_gfid (this, entry_path, &stbuf);
+ tmp_entry->d_ino = stbuf.ia_ino;
+
-+ if (whichop == GF_FOP_READDIRP) {
+ if (whichop == GF_FOP_READDIRP) {
+- list_for_each_entry (tmp_entry, &entries.list, list) {
+- strcpy (entry_path + real_path_len + 1,
+- tmp_entry->d_name);
+- posix_lstat_with_gfid (this, entry_path, &stbuf);
+- tmp_entry->d_ino = stbuf.ia_ino;
tmp_entry->d_stat = stbuf;
}
}
diff --git a/filesystems/glusterfs/patches/patch-bw b/filesystems/glusterfs/patches/patch-bw
index 0b894fc1c9a..233bdb0a70f 100644
--- a/filesystems/glusterfs/patches/patch-bw
+++ b/filesystems/glusterfs/patches/patch-bw
@@ -1,4 +1,4 @@
-$NetBSD: patch-bw,v 1.1 2011/10/16 05:45:19 manu Exp $
+$NetBSD: patch-bw,v 1.2 2011/11/28 08:42:39 manu Exp $
usleep(3) shall not be called with argument higher than 1s
diff --git a/filesystems/glusterfs/patches/patch-bx b/filesystems/glusterfs/patches/patch-bx
index 068cedd55d9..37609ef33cd 100644
--- a/filesystems/glusterfs/patches/patch-bx
+++ b/filesystems/glusterfs/patches/patch-bx
@@ -1,4 +1,4 @@
-$NetBSD: patch-bx,v 1.1 2011/10/25 08:34:28 manu Exp $
+$NetBSD: patch-bx,v 1.2 2011/11/28 08:42:39 manu Exp $
glusterfs may need lots of data, raise the limit and hope there's enough
ram ...
diff --git a/filesystems/glusterfs/patches/patch-by b/filesystems/glusterfs/patches/patch-by
deleted file mode 100644
index b753b25be39..00000000000
--- a/filesystems/glusterfs/patches/patch-by
+++ /dev/null
@@ -1,458 +0,0 @@
-$NetBSD: patch-by,v 1.1 2011/10/30 05:07:15 manu Exp $
-
-Pull inode generation fix from upstream
-
-
---- xlators/cluster/afr/src/afr-common.c.orig 2011-08-23 14:31:39.000000000 +0200
-+++ xlators/cluster/afr/src/afr-common.c 2011-10-29 10:13:59.000000000 +0200
-@@ -891,12 +891,9 @@
-
- first_up_child = afr_first_up_child (priv);
-
- if (child_index == first_up_child) {
-- local->cont.lookup.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- first_up_child);
-+ local->cont.lookup.ino = buf->ia_ino;
- }
-
- if (local->success_count == 0) {
- if (local->op_errno != ESTALE)
-@@ -919,11 +916,10 @@
- uuid_copy (local->loc.gfid, buf->ia_gfid);
- uuid_copy (local->loc.pargfid,
- postparent->ia_gfid);
-
-- lookup_buf->ia_ino = afr_itransform (buf->ia_ino,
-- priv->child_count,
-- child_index);
-+ lookup_buf->ia_ino = buf->ia_ino;
-+
- if (priv->read_child >= 0) {
- afr_set_read_child (this,
- local->cont.lookup.inode,
- priv->read_child);
-@@ -1014,12 +1010,9 @@
-
- first_up_child = afr_first_up_child (priv);
-
- if (child_index == first_up_child) {
-- local->cont.lookup.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- first_up_child);
-+ local->cont.lookup.ino = buf->ia_ino;
- }
-
- /* in case of revalidate, we need to send stat of the
- * child whose stat was sent during the first lookup.
-@@ -1039,11 +1032,9 @@
- local->cont.lookup.postparent = *postparent;
-
- *lookup_buf = *buf;
-
-- lookup_buf->ia_ino = afr_itransform (buf->ia_ino,
-- priv->child_count,
-- child_index);
-+ lookup_buf->ia_ino = buf->ia_ino;
-
- if (priv->read_child >= 0) {
- afr_set_read_child (this,
- local->cont.lookup.inode,
-@@ -1581,11 +1572,8 @@
-
- call_count = afr_frame_return (frame);
-
- if (call_count == 0) {
-- local->cont.fsync.prebuf.ia_ino = local->cont.fsync.ino;
-- local->cont.fsync.postbuf.ia_ino = local->cont.fsync.ino;
--
- AFR_STACK_UNWIND (fsync, frame, local->op_ret, local->op_errno,
- &local->cont.fsync.prebuf,
- &local->cont.fsync.postbuf);
- }
---- xlators/cluster/afr/src/afr-dir-read.c.orig 2011-08-23 14:31:39.000000000 +0200
-+++ xlators/cluster/afr/src/afr-dir-read.c 2011-10-29 10:14:22.000000000 +0200
-@@ -494,12 +494,8 @@
- if (op_ret == -1)
- goto out;
-
- list_for_each_entry_safe (entry, tmp, &entries->list, list) {
-- entry->d_ino = afr_itransform (entry->d_ino,
-- priv->child_count,
-- child_index);
--
- if ((local->fd->inode == local->fd->inode->table->root)
- && !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
- list_del_init (&entry->list);
- GF_FREE (entry);
-@@ -519,9 +515,8 @@
- {
- afr_private_t * priv = NULL;
- afr_local_t * local = NULL;
- xlator_t ** children = NULL;
-- ino_t inum = 0;
- int call_child = 0;
- int first_call_child = 0;
- int ret = 0;
- gf_dirent_t * entry = NULL;
-@@ -581,15 +576,8 @@
- }
-
- if (op_ret != -1) {
- list_for_each_entry_safe (entry, tmp, &entries->list, list) {
-- inum = afr_itransform (entry->d_ino, priv->child_count,
-- call_child);
-- entry->d_ino = inum;
-- inum = afr_itransform (entry->d_stat.ia_ino,
-- priv->child_count, call_child);
-- entry->d_stat.ia_ino = inum;
--
- if ((local->fd->inode == local->fd->inode->table->root)
- && !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
- list_del_init (&entry->list);
- GF_FREE (entry);
---- xlators/cluster/afr/src/afr-dir-write.c.orig 2011-08-23 14:31:39.000000000 +0200
-+++ xlators/cluster/afr/src/afr-dir-write.c 2011-10-28 06:50:34.000000000 +0200
-@@ -100,13 +100,8 @@
- } else {
- unwind_buf = &local->cont.create.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.create.ino;
--
-- local->cont.create.preparent.ia_ino = local->cont.create.parent_ino;
-- local->cont.create.postparent.ia_ino = local->cont.create.parent_ino;
--
- AFR_STACK_UNWIND (create, main_frame,
- local->op_ret, local->op_errno,
- local->cont.create.fd,
- local->cont.create.inode,
-@@ -173,13 +168,8 @@
-
- if (local->success_count == 0) {
- local->cont.create.buf = *buf;
-
-- local->cont.create.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- child_index);
--
- if (priv->read_child >= 0) {
- afr_set_read_child (this, inode,
- priv->read_child);
- } else {
-@@ -187,15 +177,8 @@
- local->read_child_index);
- }
- }
-
-- if (child_index == local->first_up_child) {
-- local->cont.create.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- local->first_up_child);
-- }
--
- if (child_index == local->read_child_index) {
- local->cont.create.read_child_buf = *buf;
- local->cont.create.preparent = *preparent;
- local->cont.create.postparent = *postparent;
-@@ -381,13 +364,8 @@
- } else {
- unwind_buf = &local->cont.mknod.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.mknod.ino;
--
-- local->cont.mknod.preparent.ia_ino = local->cont.mknod.parent_ino;
-- local->cont.mknod.postparent.ia_ino = local->cont.mknod.parent_ino;
--
- AFR_STACK_UNWIND (mknod, main_frame,
- local->op_ret, local->op_errno,
- local->cont.mknod.inode,
- unwind_buf, &local->cont.mknod.preparent,
-@@ -423,12 +401,8 @@
- local->op_ret = op_ret;
-
- if (local->success_count == 0){
- local->cont.mknod.buf = *buf;
-- local->cont.mknod.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- child_index);
-
- if (priv->read_child >= 0) {
- afr_set_read_child (this, inode,
- priv->read_child);
-@@ -437,15 +411,8 @@
- local->read_child_index);
- }
- }
-
-- if (child_index == local->first_up_child) {
-- local->cont.mknod.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- local->first_up_child);
-- }
--
- if (child_index == local->read_child_index) {
- local->cont.mknod.read_child_buf = *buf;
- local->cont.mknod.preparent = *preparent;
- local->cont.mknod.postparent = *postparent;
-@@ -624,13 +591,8 @@
- } else {
- unwind_buf = &local->cont.mkdir.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.mkdir.ino;
--
-- local->cont.mkdir.preparent.ia_ino = local->cont.mkdir.parent_ino;
-- local->cont.mkdir.postparent.ia_ino = local->cont.mkdir.parent_ino;
--
- AFR_STACK_UNWIND (mkdir, main_frame,
- local->op_ret, local->op_errno,
- local->cont.mkdir.inode,
- unwind_buf, &local->cont.mkdir.preparent,
-@@ -667,13 +629,8 @@
-
- if (local->success_count == 0) {
- local->cont.mkdir.buf = *buf;
-
-- local->cont.mkdir.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- child_index);
--
- if (priv->read_child >= 0) {
- afr_set_read_child (this, inode,
- priv->read_child);
- } else {
-@@ -681,15 +638,8 @@
- local->read_child_index);
- }
- }
-
-- if (child_index == local->first_up_child) {
-- local->cont.mkdir.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- local->first_up_child);
-- }
--
- if (child_index == local->read_child_index) {
- local->cont.mkdir.read_child_buf = *buf;
- local->cont.mkdir.preparent = *preparent;
- local->cont.mkdir.postparent = *postparent;
-@@ -869,13 +819,8 @@
- } else {
- unwind_buf = &local->cont.link.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.link.ino;
--
-- local->cont.link.preparent.ia_ino = local->cont.link.parent_ino;
-- local->cont.link.postparent.ia_ino = local->cont.link.parent_ino;
--
- AFR_STACK_UNWIND (link, main_frame,
- local->op_ret, local->op_errno,
- local->cont.link.inode,
- unwind_buf, &local->cont.link.preparent,
-@@ -1099,13 +1044,8 @@
- } else {
- unwind_buf = &local->cont.symlink.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.symlink.ino;
--
-- local->cont.symlink.preparent.ia_ino = local->cont.symlink.parent_ino;
-- local->cont.symlink.postparent.ia_ino = local->cont.symlink.parent_ino;
--
- AFR_STACK_UNWIND (symlink, main_frame,
- local->op_ret, local->op_errno,
- local->cont.symlink.inode,
- unwind_buf, &local->cont.symlink.preparent,
-@@ -1141,11 +1081,8 @@
- local->op_ret = op_ret;
-
- if (local->success_count == 0) {
- local->cont.symlink.buf = *buf;
-- local->cont.symlink.ino =
-- afr_itransform (buf->ia_ino, priv->child_count,
-- child_index);
-
- if (priv->read_child >= 0) {
- afr_set_read_child (this, inode,
- priv->read_child);
-@@ -1154,15 +1091,8 @@
- local->read_child_index);
- }
- }
-
-- if (child_index == local->first_up_child) {
-- local->cont.symlink.ino =
-- afr_itransform (buf->ia_ino,
-- priv->child_count,
-- local->first_up_child);
-- }
--
- if (child_index == local->read_child_index) {
- local->cont.symlink.read_child_buf = *buf;
- local->cont.symlink.preparent = *preparent;
- local->cont.symlink.postparent = *postparent;
-@@ -1341,15 +1271,8 @@
- } else {
- unwind_buf = &local->cont.rename.buf;
- }
-
-- unwind_buf->ia_ino = local->cont.rename.ino;
--
-- local->cont.rename.preoldparent.ia_ino = local->cont.rename.oldparent_ino;
-- local->cont.rename.postoldparent.ia_ino = local->cont.rename.oldparent_ino;
-- local->cont.rename.prenewparent.ia_ino = local->cont.rename.newparent_ino;
-- local->cont.rename.postnewparent.ia_ino = local->cont.rename.newparent_ino;
--
- AFR_STACK_UNWIND (rename, main_frame,
- local->op_ret, local->op_errno,
- unwind_buf,
- &local->cont.rename.preoldparent,
-@@ -1558,11 +1481,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.unlink.preparent.ia_ino = local->cont.unlink.parent_ino;
-- local->cont.unlink.postparent.ia_ino = local->cont.unlink.parent_ino;
--
- AFR_STACK_UNWIND (unlink, main_frame,
- local->op_ret, local->op_errno,
- &local->cont.unlink.preparent,
- &local->cont.unlink.postparent);
-@@ -1758,11 +1678,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.rmdir.preparent.ia_ino = local->cont.rmdir.parent_ino;
-- local->cont.rmdir.postparent.ia_ino = local->cont.rmdir.parent_ino;
--
- AFR_STACK_UNWIND (rmdir, main_frame,
- local->op_ret, local->op_errno,
- &local->cont.rmdir.preparent,
- &local->cont.rmdir.postparent);
---- xlators/cluster/afr/src/afr-inode-read.c.orig 2011-08-23 14:31:39.000000000 +0200
-+++ xlators/cluster/afr/src/afr-inode-read.c 2011-10-28 06:50:34.000000000 +0200
-@@ -222,11 +222,8 @@
- }
-
- out:
- if (unwind) {
-- if (buf)
-- buf->ia_ino = local->cont.stat.ino;
--
- AFR_STACK_UNWIND (stat, frame, op_ret, op_errno, buf);
- }
-
- return 0;
-@@ -344,11 +341,8 @@
- }
-
- out:
- if (unwind) {
-- if (buf)
-- buf->ia_ino = local->cont.fstat.ino;
--
- AFR_STACK_UNWIND (fstat, frame, op_ret, op_errno, buf);
- }
-
- return 0;
-@@ -469,11 +463,8 @@
- }
-
- out:
- if (unwind) {
-- if (sbuf)
-- sbuf->ia_ino = local->cont.readlink.ino;
--
- AFR_STACK_UNWIND (readlink, frame, op_ret, op_errno, buf, sbuf);
- }
-
- return 0;
-@@ -876,11 +867,8 @@
- }
-
- out:
- if (unwind) {
-- if (buf && local)
-- buf->ia_ino = local->cont.readv.ino;
--
- AFR_STACK_UNWIND (readv, frame, op_ret, op_errno,
- vector, count, buf, iobref);
- }
-
---- xlators/cluster/afr/src/afr-inode-write.c.orig 2011-08-23 14:31:39.000000000 +0200
-+++ xlators/cluster/afr/src/afr-inode-write.c 2011-10-28 06:50:34.000000000 +0200
-@@ -65,11 +65,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.writev.prebuf.ia_ino = local->cont.writev.ino;
-- local->cont.writev.postbuf.ia_ino = local->cont.writev.ino;
--
- AFR_STACK_UNWIND (writev, main_frame,
- local->op_ret, local->op_errno,
- &local->cont.writev.prebuf,
- &local->cont.writev.postbuf);
-@@ -320,11 +317,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.truncate.prebuf.ia_ino = local->cont.truncate.ino;
-- local->cont.truncate.postbuf.ia_ino = local->cont.truncate.ino;
--
- AFR_STACK_UNWIND (truncate, main_frame, local->op_ret,
- local->op_errno,
- &local->cont.truncate.prebuf,
- &local->cont.truncate.postbuf);
-@@ -531,11 +525,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.ftruncate.prebuf.ia_ino = local->cont.ftruncate.ino;
-- local->cont.ftruncate.postbuf.ia_ino = local->cont.ftruncate.ino;
--
- AFR_STACK_UNWIND (ftruncate, main_frame, local->op_ret,
- local->op_errno,
- &local->cont.ftruncate.prebuf,
- &local->cont.ftruncate.postbuf);
-@@ -780,11 +771,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.setattr.preop_buf.ia_ino = local->cont.setattr.ino;
-- local->cont.setattr.postop_buf.ia_ino = local->cont.setattr.ino;
--
- AFR_STACK_UNWIND (setattr, main_frame, local->op_ret,
- local->op_errno,
- &local->cont.setattr.preop_buf,
- &local->cont.setattr.postop_buf);
-@@ -990,13 +978,8 @@
- }
- UNLOCK (&frame->lock);
-
- if (main_frame) {
-- local->cont.fsetattr.preop_buf.ia_ino =
-- local->cont.fsetattr.ino;
-- local->cont.fsetattr.postop_buf.ia_ino =
-- local->cont.fsetattr.ino;
--
- AFR_STACK_UNWIND (fsetattr, main_frame, local->op_ret,
- local->op_errno,
- &local->cont.fsetattr.preop_buf,
- &local->cont.fsetattr.postop_buf);
diff --git a/filesystems/glusterfs/patches/patch-bz b/filesystems/glusterfs/patches/patch-bz
new file mode 100644
index 00000000000..54c5022758c
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-bz
@@ -0,0 +1,24 @@
+$NetBSD: patch-bz,v 1.1 2011/11/28 08:42:39 manu Exp $
+
+When a client detects a changed gfid, it means another machine replaced
+the node. Return ESTALE that that the stall data get flushed. This avoid
+having the changed node being inaccessible forever because lookups still
+return the old deleted node.
+
+The fix is pulled from upstream.
+
+--- xlators/protocol/client/src/client3_1-fops.c.orig 2011-11-28 05:54:38.000000000 +0100
++++ xlators/protocol/client/src/client3_1-fops.c 2011-11-28 05:59:46.000000000 +0100
+@@ -2210,9 +2210,11 @@
+ if ((!uuid_is_null (inode->gfid))
+ && (uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) {
+ gf_log (frame->this->name, GF_LOG_WARNING,
+ "gfid changed for %s", local->loc.path);
+- memcpy(&stbuf.ia_gfid, &inode->gfid, sizeof(inode->gfid));
++ rsp.op_ret = -1;
++ op_errno = ESTALE;
++ goto out;
+ }
+
+ rsp.op_ret = 0;
+