From 4029aa5aa014b953605fbdacfc2609e4ffa99978 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 10 Feb 2006 21:29:56 +0000 Subject: [PATCH] Branch b_release_1_4_6 Fix compile warning in ll_{dir,file}_ioctl() from bug 5972 landing. b=5972 Improve assertion message in ll_ap_make_ready() for debugging. b=10089 --- lustre/llite/dir.c | 10 +++++----- lustre/llite/file.c | 8 ++++---- lustre/llite/llite_lib.c | 26 +++++++++++++------------- lustre/llite/rw.c | 3 ++- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 1408920..8102e50 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -488,11 +488,11 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, int rc, lmmsize; ll_inode2fid(&fid, inode); - + rc = ll_get_max_mdsize(sbi, &lmmsize); - if (rc) - RETURN(rc); - + if (rc) + RETURN(rc); + rc = mdc_getattr(sbi->ll_mdc_exp, &fid, OBD_MD_FLDIREA, lmmsize, &request); if (rc < 0) { @@ -532,7 +532,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, return rc; } case LL_IOC_OBD_STATFS: - RETURN(ll_obd_statfs(inode, arg)); + RETURN(ll_obd_statfs(inode, (void *)arg)); case IOC_MDC_GETFILEINFO: case IOC_MDC_GETSTRIPE: { struct ptlrpc_request *request = NULL; diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 41848b3..063eed3 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1179,7 +1179,7 @@ static int ll_lov_getstripe(struct inode *inode, unsigned long arg) } static int ll_get_grouplock(struct inode *inode, struct file *file, - unsigned long arg) + unsigned long arg) { struct ll_file_data *fd = LUSTRE_FPRIVATE(file); ldlm_policy_data_t policy = { .l_extent = { .start = 0, @@ -1210,7 +1210,7 @@ static int ll_get_grouplock(struct inode *inode, struct file *file, } static int ll_put_grouplock(struct inode *inode, struct file *file, - unsigned long arg) + unsigned long arg) { struct ll_file_data *fd = LUSTRE_FPRIVATE(file); struct ll_inode_info *lli = ll_i2info(inode); @@ -1471,7 +1471,7 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd, RETURN(ll_iocontrol(inode, file, cmd, arg)); case EXT3_IOC_GETVERSION_OLD: case EXT3_IOC_GETVERSION: - RETURN(put_user(inode->i_generation, (int *) arg)); + RETURN(put_user(inode->i_generation, (int *)arg)); case LL_IOC_JOIN: { char *ftail; int rc; @@ -1488,7 +1488,7 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case LL_IOC_GROUP_UNLOCK: RETURN(ll_put_grouplock(inode, file, arg)); case LL_IOC_OBD_STATFS: - RETURN(ll_obd_statfs(inode, arg)); + RETURN(ll_obd_statfs(inode, (void *)arg)); /* We need to special case any other ioctls we want to handle, * to send them to the MDS/OST as appropriate and to properly diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 6aa56bd..e6c88e5 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1799,20 +1799,20 @@ int ll_obd_statfs(struct inode *inode, void *arg) char *buf = NULL; struct obd_ioctl_data *data = NULL; __u32 type, index; - int len, rc, rc2; - + int len, rc; + if (!inode || !(sbi = ll_i2sbi(inode))) GOTO(out_statfs, rc = -EINVAL); rc = obd_ioctl_getdata(&buf, &len, arg); if (rc) GOTO(out_statfs, rc); - + data = (void*)buf; if (!data->ioc_inlbuf1 || !data->ioc_inlbuf2 || !data->ioc_pbuf1 || !data->ioc_pbuf2) GOTO(out_statfs, rc = -EINVAL); - + memcpy(&type, data->ioc_inlbuf1, sizeof(__u32)); memcpy(&index, data->ioc_inlbuf2, sizeof(__u32)); @@ -1824,33 +1824,33 @@ int ll_obd_statfs(struct inode *inode, void *arg) } else if (type == LL_STATFS_LOV) { lov_obd = class_exp2obd(sbi->ll_osc_exp); lov = &lov_obd->u.lov; - + if (index >= lov->desc.ld_tgt_count) GOTO(out_statfs, rc = -ENODEV); - + client_obd = class_exp2obd(lov->tgts[index].ltd_exp); client_imp = class_exp2cliimp(lov->tgts[index].ltd_exp); if (!lov->tgts[index].active) GOTO(out_uuid, rc = -ENODATA); } - + if (!client_obd || !client_imp) GOTO(out_statfs, rc = -EINVAL); rc = obd_statfs(client_obd, &stat_buf, jiffies - 1); if (rc) GOTO(out_statfs, rc); - rc = copy_to_user(data->ioc_pbuf1, &stat_buf, data->ioc_plen1); - if (rc) + + if (copy_to_user(data->ioc_pbuf1, &stat_buf, data->ioc_plen1)) GOTO(out_statfs, rc = -EFAULT); + out_uuid: - rc2 = copy_to_user(data->ioc_pbuf2, &client_imp->imp_target_uuid, - data->ioc_plen2); - if (rc2) + if (copy_to_user(data->ioc_pbuf2, &client_imp->imp_target_uuid, + data->ioc_plen2)) rc = -EFAULT; out_statfs: if (buf) obd_ioctl_freedata(buf, len); - return rc; + return rc; } diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index bca0abd..eef126b 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -274,7 +274,8 @@ static int ll_ap_make_ready(void *data, int cmd) llap = LLAP_FROM_COOKIE(data); page = llap->llap_page; - LASSERT(!(cmd & OBD_BRW_READ)); + LASSERTF(!(cmd & OBD_BRW_READ), "cmd %x page %p ino %lu index %lu\n", cmd, page, + page->mapping->host->i_ino, page->index); /* we're trying to write, but the page is locked.. come back later */ if (TryLockPage(page)) -- 1.8.3.1