summaryrefslogtreecommitdiff
path: root/filesystems
diff options
context:
space:
mode:
authormanu <manu@pkgsrc.org>2011-10-30 05:07:14 +0000
committermanu <manu@pkgsrc.org>2011-10-30 05:07:14 +0000
commit278a31b17bdab2017d70e8a8ee61947410df6414 (patch)
tree882717109d1cae0ba8a7ab02c1cf33430b56ffaa /filesystems
parentd744bcd52a54a86990bdf94b7dc34a85b2ab87fb (diff)
downloadpkgsrc-278a31b17bdab2017d70e8a8ee61947410df6414.tar.gz
Additionnal fixes from upstream to ensure inodes are consistent for
all operations (readdir and getattr)
Diffstat (limited to 'filesystems')
-rw-r--r--filesystems/glusterfs/Makefile4
-rw-r--r--filesystems/glusterfs/distinfo5
-rw-r--r--filesystems/glusterfs/patches/patch-br31
-rw-r--r--filesystems/glusterfs/patches/patch-by458
4 files changed, 484 insertions, 14 deletions
diff --git a/filesystems/glusterfs/Makefile b/filesystems/glusterfs/Makefile
index c69ec5e6b59..9a2fd91c7ba 100644
--- a/filesystems/glusterfs/Makefile
+++ b/filesystems/glusterfs/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.21 2011/10/25 09:23:37 manu Exp $
+# $NetBSD: Makefile,v 1.22 2011/10/30 05:07:14 manu Exp $
#
DISTNAME= glusterfs-3.2.3
-PKGREVISION= 4
+PKGREVISION= 7
CATEGORIES= filesystems
MASTER_SITES= http://download.gluster.com/pub/gluster/glusterfs/3.2/3.2.3/
diff --git a/filesystems/glusterfs/distinfo b/filesystems/glusterfs/distinfo
index f2fda651012..e0c8329a145 100644
--- a/filesystems/glusterfs/distinfo
+++ b/filesystems/glusterfs/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2011/10/25 09:23:37 manu Exp $
+$NetBSD: distinfo,v 1.18 2011/10/30 05:07:14 manu Exp $
SHA1 (glusterfs-3.2.3.tar.gz) = 7a36e496d9ac3fbf11123bb42884445334d07f06
RMD160 (glusterfs-3.2.3.tar.gz) = 89d6a5f9c1362e1fe4d88e69465311069552d319
@@ -26,10 +26,11 @@ SHA1 (patch-bn) = 98ce48be2239f42edc4ef8e26644305f6aa0a5eb
SHA1 (patch-bo) = be0dcdcc0acb6a5e54664372c34a28f1307fbd00
SHA1 (patch-bp) = 77463ea7d739d532e20dbe5bd66d58c22ba0c248
SHA1 (patch-bq) = 7a59abc6ea5966a9f99be86fe31e3507f02b932a
-SHA1 (patch-br) = c4b315c0e05823fa9afef9d3a03b5fa4c25f515b
+SHA1 (patch-br) = c60d583f8f658ff56717a00b3cc1b5bd983611e6
SHA1 (patch-bs) = d2f79ef19143f74f5a12187ea2dfd9e1ed92b726
SHA1 (patch-bt) = 58f8e5ce66e6b691dd9972bd649dc18f7d5a258a
SHA1 (patch-bu) = 006a6802958fad3950eadad456e362b7f4c2ca4a
SHA1 (patch-bv) = 2c3b654e5858bf0948307ca6ae7048e276fca9ef
SHA1 (patch-bw) = dca12eb81163fd1a0ada13165e990ddcb8fefbf2
SHA1 (patch-bx) = b2aca473091bb64d14c6da046379d33ca8a5785e
+SHA1 (patch-by) = 0ad488ceea4d388636fb2cc732e6dfadecf0afbf
diff --git a/filesystems/glusterfs/patches/patch-br b/filesystems/glusterfs/patches/patch-br
index 0aeaa678f39..67dcb27f0e3 100644
--- a/filesystems/glusterfs/patches/patch-br
+++ b/filesystems/glusterfs/patches/patch-br
@@ -1,4 +1,4 @@
-$NetBSD: patch-br,v 1.7 2011/10/25 09:23:37 manu Exp $
+$NetBSD: patch-br,v 1.8 2011/10/30 05:07:15 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
@@ -11,8 +11,8 @@ volumes fails.
Also pull upstreampatch that fix inode generation so that values
are reliable
---- xlators/storage/posix/src/posix.c.orig 2011-10-25 11:01:33.000000000 +0200
-+++ xlators/storage/posix/src/posix.c 2011-10-25 10:54:29.000000000 +0200
+--- 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
@@ -36,8 +36,12 @@
#ifndef GF_BSD_HOST_OS
#include <alloca.h>
@@ -40,7 +40,7 @@ are reliable
+
+ /* 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;
+ }
+
@@ -107,12 +107,23 @@ are reliable
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
"link %s to %s failed: %s",
-@@ -4381,8 +4420,9 @@
- 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;
+@@ -4376,13 +4415,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) {
tmp_entry->d_stat = stbuf;
}
}
diff --git a/filesystems/glusterfs/patches/patch-by b/filesystems/glusterfs/patches/patch-by
new file mode 100644
index 00000000000..b753b25be39
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-by
@@ -0,0 +1,458 @@
+$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);