[Lustre-discuss] Liblustreapi crash

Suvendra Nath Dutta suvendra_dutta at harvard.edu
Mon Aug 18 13:02:26 PDT 2008


I am trying to run the Code:
#include <stdio.h>
#include <unistd.h>
#include <lustre/liblustreapi.h>
#include <sys/types.h>
#include <pwd.h>
#include <string.h>
#include <errno.h>

int main(int argc, char *argv[])
{
    struct if_quotactl qctl;
    char szpath[FILENAME_MAX];
    struct passwd *pw;
    uid_t uid;
    gid_t gid;
    int rc;

    pw = getpwuid(geteuid());

    if (!pw) {
        fprintf(stderr, "%s: getpwuid on geteuid failed!\n", argv[0]);
        return -1;
    }
    uid = pw->pw_uid;
    gid = pw->pw_gid;
    sprintf(szpath, "/n/circelfs");
    memset(&qctl, 0, sizeof(qctl));
    qctl.qc_cmd = LUSTRE_Q_GETQUOTA;
    qctl.qc_id = gid;
    qctl.qc_type = UGQUOTA;

    rc = llapi_quotactl(szpath, &qctl);
    if (rc) {
        fprintf(stderr, "%s: llapi_quotactl %s: %s\n",
                argv[0], szpath, strerror(errno));
        return rc;
    }
    struct obd_dqblk *dqb = &qctl.qc_dqblk;
    printf("Quota for %s on %s: %ld\n", pw->pw_name, szpath,
            dqb->dqb_bhardlimit*QUOTABLOCK_SIZE);
    return 0;
}

Compiled using the Makefile:
CC=gcc
CFLAGS=-g 
LIBS=-llustreapi -lm
RM=/bin/rm

EXECS = rquota
OBJS = rquota.o 

all: $(EXECS)

$(EXECS): $(OBJS) Makefile
        $(CC) $(CFLAGS) -o $(EXECS) $(OBJS) $(LIBS)

$(OBJS): Makefile

.c.o:
        $(CC) $(CFLAGS) -o $*.o -c $*.c
clean:
        $(RM) -f $(EXECS) $(OBJS)


The resulting executable is run as a regular user on a client.

Doing so however, consistently crashes the MDS server and the client. We are
running the current version of Lustre 1.6.5.1

Any idea what could be going wrong here?

Thanks.

Suvendra.




More information about the lustre-discuss mailing list