diff options
Diffstat (limited to 'filesystems/glusterfs/patches/patch-br')
-rw-r--r-- | filesystems/glusterfs/patches/patch-br | 78 |
1 files changed, 21 insertions, 57 deletions
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; } } |