Update to 3.1.2, apply CloudFS patches.

This commit is contained in:
Jonathan Steffan 2011-02-03 17:09:14 -07:00
parent 0fd2baad28
commit 9d5d32a0e0
4 changed files with 141 additions and 3 deletions

67
dht-fsetxattr.patch Normal file
View File

@ -0,0 +1,67 @@
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index e204726..df0033a 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2068,6 +2068,50 @@ err:
return 0;
}
+int
+dht_fsetxattr (call_frame_t *frame, xlator_t *this,
+ fd_t *fd, dict_t *xattr, int flags)
+{
+ xlator_t *subvol = NULL;
+ dht_local_t *local = NULL;
+ int op_errno = EINVAL;
+
+ VALIDATE_OR_GOTO (frame, err);
+ VALIDATE_OR_GOTO (this, err);
+ VALIDATE_OR_GOTO (fd, err);
+ VALIDATE_OR_GOTO (fd->inode, err);
+
+ subvol = dht_subvol_get_cached (this, fd->inode);
+ if (!subvol) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "no cached subvolume for fd=%p", fd);
+ op_errno = EINVAL;
+ goto err;
+ }
+
+ local = dht_local_init (frame);
+ if (!local) {
+ op_errno = ENOMEM;
+ gf_log (this->name, GF_LOG_ERROR,
+ "Out of memory");
+ goto err;
+ }
+
+ local->inode = inode_ref (fd->inode);
+ local->call_cnt = 1;
+
+ STACK_WIND (frame, dht_err_cbk, subvol, subvol->fops->fsetxattr,
+ fd, xattr, flags);
+
+ return 0;
+
+err:
+ op_errno = (op_errno == -1) ? errno : op_errno;
+ DHT_STACK_UNWIND (fsetxattr, frame, -1, op_errno);
+
+ return 0;
+}
+
int
dht_removexattr (call_frame_t *frame, xlator_t *this,
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index 93d01f1..3f81ba7 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -491,6 +491,7 @@ struct xlator_fops fops = {
.access = dht_access,
.readlink = dht_readlink,
.setxattr = dht_setxattr,
+ .fsetxattr = dht_fsetxattr,
.getxattr = dht_getxattr,
.removexattr = dht_removexattr,
.open = dht_open,

View File

@ -8,7 +8,7 @@
Name: glusterfs Name: glusterfs
Version: %{major_minor}.2 Version: %{major_minor}.2
Release: 1%{?dist} Release: 2%{?dist}
Summary: Clustered file-system Summary: Clustered file-system
Group: System Environment/Base Group: System Environment/Base
@ -25,6 +25,15 @@ Source11: glusterfsd.init
Source12: glusterfsd.sysconfig Source12: glusterfsd.sysconfig
Source15: glusterfsd.logrotate Source15: glusterfsd.logrotate
# bugs.gluster.com #2309 (pending)
Patch1: wb-quota.patch
# bugs.gluster.com #2311 (pending)
Patch2: dht-fsetxattr.patch
# CloudFS-specific
Patch3: inode-gen.patch
BuildRequires: bison BuildRequires: bison
BuildRequires: flex BuildRequires: flex
BuildRequires: gcc BuildRequires: gcc
@ -145,6 +154,9 @@ This package provides the development libraries.
%prep %prep
%setup -q %setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build %build
%configure %configure
@ -162,13 +174,25 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# We'll use our init.d # We'll use our init.d
%{__rm} -f %{buildroot}%{_sysconfdir}/init.d/glusterd %{__rm} -f %{buildroot}%{_sysconfdir}/init.d/glusterd
# Install include directory
%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterd %{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterd
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfs %{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfs
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfsd %{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfsd
# Install include directory
%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs
%{__install} -p -m 0644 libglusterfs/src/*.h \ %{__install} -p -m 0644 libglusterfs/src/*.h \
%{buildroot}%{_includedir}/glusterfs/ %{buildroot}%{_includedir}/glusterfs/
%{__install} -p -m 0644 contrib/uuid/*.h \
%{buildroot}%{_includedir}/glusterfs/
# Following needed by cloudfs multi-tenant translator
%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs/rpc
%{__install} -p -m 0644 rpc/rpc-lib/src/*.h \
%{buildroot}%{_includedir}/glusterfs/rpc/
%{__install} -p -m 0644 rpc/xdr/src/*.h \
%{buildroot}%{_includedir}/glusterfs/rpc/
%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs/server
%{__install} -p -m 0644 xlators/protocol/server/src/*.h \
%{buildroot}%{_includedir}/glusterfs/server/
# Remove unwanted files from all the shared libraries # Remove unwanted files from all the shared libraries
find %{buildroot}%{_libdir} -name '*.a' -delete find %{buildroot}%{_libdir} -name '*.a' -delete
@ -311,6 +335,9 @@ if [ $1 -ge 1 ]; then
fi fi
%changelog %changelog
* Tue Feb 03 2011 Jonathan Steffan <jsteffan@fedoraproject.org> - 3.1.2-2
- Add patches from CloudFS project
* Tue Jan 25 2011 Jonathan Steffan <jsteffan@fedoraproject.org> - 3.1.2-1 * Tue Jan 25 2011 Jonathan Steffan <jsteffan@fedoraproject.org> - 3.1.2-1
- Update to 3.1.2 - Update to 3.1.2

12
inode-gen.patch Normal file
View File

@ -0,0 +1,12 @@
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
index 15a4f98..3c95407 100644
--- a/libglusterfs/src/inode.h
+++ b/libglusterfs/src/inode.h
@@ -104,6 +104,7 @@ struct _inode {
struct list_head list; /* active/lru/purge */
struct _inode_ctx *_ctx; /* replacement for dict_t *(inode->ctx) */
+ uint64_t gen; /* for locking code */
};

32
wb-quota.patch Normal file
View File

@ -0,0 +1,32 @@
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 43956a9..d97812a 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1667,7 +1667,8 @@ __wb_get_other_requests (list_head_t *list, list_head_t *other_requests)
int32_t
wb_stack_unwind (list_head_t *unwinds)
{
- struct iatt buf = {0,};
+ struct iatt prebuf = {0,};
+ struct iatt postbuf = {0,};
wb_request_t *request = NULL, *dummy = NULL;
call_frame_t *frame = NULL;
wb_local_t *local = NULL;
@@ -1678,8 +1679,15 @@ wb_stack_unwind (list_head_t *unwinds)
frame = request->stub->frame;
local = frame->local;
- STACK_UNWIND (frame, local->op_ret, local->op_errno, &buf,
- &buf);
+ /*
+ * There are probably a lot of other problems with returning
+ * these bogus iatts, but this fix at least gives us enough
+ * information for features/quota to work (sort of).
+ */
+ postbuf.ia_blocks = (request->write_size + 511) / 512;
+
+ STACK_UNWIND (frame, local->op_ret, local->op_errno,
+ &prebuf, &postbuf);
ret = wb_request_unref (request);
if (ret == 0) {