From ecea0c8776ea2d085e35198d13ea41c4fbf49a8e Mon Sep 17 00:00:00 2001 From: Vladimir Saveliev Date: Fri, 8 Oct 2010 14:36:26 +0400 Subject: [PATCH 1/1] b=22766 cascading_rw: take lmm_stripe_count returned by ioctl(LL_IOC_LOV_SETSTRIPE) i=adilger --- lustre/llite/dir.c | 11 +++++++---- lustre/tests/mpi/cascading_rw.c | 8 -------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index f5cf954..3ea338a 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -918,8 +918,11 @@ out_free: lmdp = (struct lov_user_mds_data *)arg; lump = &lmdp->lmd_lmm; } - if (cfs_copy_to_user(lump, lmm, lmmsize)) - GOTO(out_req, rc = -EFAULT); + if (cfs_copy_to_user(lump, lmm, lmmsize)) { + if (cfs_copy_to_user(lump, lmm, sizeof(*lump))) + GOTO(out_req, rc = -EFAULT); + rc = -EOVERFLOW; + } skip_lmm: if (cmd == IOC_MDC_GETFILEINFO || cmd == LL_IOC_MDC_GETINFO) { struct lov_user_mds_data *lmdp; @@ -1113,7 +1116,7 @@ out_free: CDEBUG(D_QUOTA, "mdc ioctl %d failed: %d\n", cmd, rc); if (cfs_copy_to_user((void *)arg, check, sizeof(*check))) - rc = -EFAULT; + CDEBUG(D_QUOTA, "cfs_copy_to_user failed\n"); GOTO(out_poll, rc); } @@ -1123,7 +1126,7 @@ out_free: CDEBUG(D_QUOTA, "osc ioctl %d failed: %d\n", cmd, rc); if (cfs_copy_to_user((void *)arg, check, sizeof(*check))) - rc = -EFAULT; + CDEBUG(D_QUOTA, "cfs_copy_to_user failed\n"); GOTO(out_poll, rc); } out_poll: diff --git a/lustre/tests/mpi/cascading_rw.c b/lustre/tests/mpi/cascading_rw.c index fe91c20..08b48e8 100644 --- a/lustre/tests/mpi/cascading_rw.c +++ b/lustre/tests/mpi/cascading_rw.c @@ -68,7 +68,6 @@ char *testdir = NULL; void rw_file(char *name, long stride, unsigned int seed) { char filename[MAX_FILENAME_LEN]; - char path[MAX_FILENAME_LEN]; char errmsg[MAX_FILENAME_LEN+20]; char *buf, *o_buf; struct lov_user_md lum = {0}; @@ -103,13 +102,6 @@ void rw_file(char *name, long stride, unsigned int seed) sprintf(errmsg, "close of file %s", filename); FAIL(errmsg); } - - strncpy(path, filename, MAX_FILENAME_LEN); - rc = llapi_file_get_stripe(path, &lum); - if (rc == -1) { - sprintf(errmsg, "get stripe of file %s", filename); - FAIL(errmsg); - } } MPI_Barrier(MPI_COMM_WORLD); -- 1.8.3.1