Handle a crash in inode.c on 32 bit, big endian platform

Thanks to  <tlisiecki@proximetry.pl> for reporting the bug and
sending the patch.

Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 985 (Crash with SEGV in libglusterfs on 32 bit, big endian platform)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=985
This commit is contained in:
Amar Tumballi 2010-07-06 08:47:25 +00:00 committed by Anand V. Avati
parent 9071758636
commit f0578eb3ac

View File

@ -282,8 +282,8 @@ __inode_destroy (inode_t *inode)
goto noctx;
for (index = 0; index < inode->table->xl->graph->xl_count; index++) {
if (inode->_ctx[index].key) {
xl = (xlator_t *)(long)inode->_ctx[index].key;
if (inode->_ctx[index].xl_key) {
xl = (xlator_t *)(long)inode->_ctx[index].xl_key;
old_THIS = THIS;
THIS = xl;
if (xl->cbks->forget)
@ -1175,7 +1175,7 @@ __inode_ctx_put2 (inode_t *inode, xlator_t *xlator, uint64_t value1,
int put_idx = -1;
for (index = 0; index < xlator->graph->xl_count; index++) {
if (!inode->_ctx[index].key) {
if (!inode->_ctx[index].xl_key) {
if (put_idx == -1)
put_idx = index;
/* dont break, to check if key already exists
@ -1373,8 +1373,8 @@ inode_dump (inode_t *inode, char *prefix)
goto out;
for (i = 0; i < inode->table->xl->graph->xl_count; i++) {
if (inode->_ctx[i].key) {
xl = (xlator_t *)(long)inode->_ctx[i].key;
if (inode->_ctx[i].xl_key) {
xl = (xlator_t *)(long)inode->_ctx[i].xl_key;
if (xl->dumpops && xl->dumpops->inodectx)
xl->dumpops->inodectx (xl, inode);
}