From bf9e4330e4108e0dbab8ebf300bf7998551b9589 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 28 Oct 2014 18:19:30 -0700 Subject: rebalance: ``check_free_space`` should ignore quota_statfs quota_statfs() returns aggregated details of space usage of bricks this causes distribute to be confused during ``rebalance``, where ``statfs()`` values are used to schedule file migration. We can make sure the values of ``statfs`` are from individual bricks by selectively instructing ``quota_statfs()`` to return non aggregated values. Change-Id: I1397faeee66a1b9c26709cfda693286d227a4170 BUG: 1158262 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/8996 Tested-by: Gluster Build System Reviewed-by: N Balachandran Reviewed-by: Krutika Dhananjay Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Vijay Bellur --- libglusterfs/src/syncop.c | 11 +++++++++-- libglusterfs/src/syncop.h | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 3e176cffc17..e830d830229 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1438,6 +1438,8 @@ syncop_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret == 0) { args->statvfs_buf = *buf; + if (xdata) + args->xdata = dict_ref (xdata); } __wake (args); @@ -1447,16 +1449,21 @@ syncop_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int -syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf) +syncop_statfs (xlator_t *subvol, loc_t *loc, dict_t *xdata_req, + struct statvfs *buf, dict_t **xdata_rsp) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_statfs_cbk, subvol->fops->statfs, - loc, NULL); + loc, xdata_req); if (buf) *buf = args.statvfs_buf; + if (xdata_rsp) + *xdata_rsp = args.xdata; + else if (args.xdata) + dict_unref (args.xdata); if (args.op_ret < 0) return -args.op_errno; diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 31438b17883..249abb3d331 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -361,7 +361,9 @@ int syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid, /* out */ struct iatt *preop, struct iatt *postop); -int syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf); +int syncop_statfs (xlator_t *subvol, loc_t *loc, dict_t *xattr_req, + /* out */ + struct statvfs *buf, dict_t **xattr_rsp); int syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags); int syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags); -- cgit