From 076cba6060a75ca1fb316e9dc921e7081e8b2a29 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 9 Apr 2002 21:55:56 +0000 Subject: [PATCH] osc/osc_request.c: replace "n" with "pages", as "n" is not defined anywhere. others: minor cleanups. --- lustre/include/linux/lustre_mds.h | 9 ++++++++- lustre/mds/mds_ext2.c | 2 +- lustre/mds/mds_ext3.c | 2 +- lustre/osc/osc_request.c | 2 +- lustre/tests/runfailure-net | 4 ++-- lustre/tests/testreq.c | 4 ++-- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index f158be2..52a1d97 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -142,11 +142,18 @@ static inline int mds_fs_commit(struct mds_obd *mds, struct inode *inode, static inline int mds_fs_setattr(struct mds_obd *mds, struct dentry *dentry, void *handle, struct iattr *iattr) { + /* + * NOTE: we probably don't need to take i_sem here when changing + * ATTR_SIZE because the MDS never needs to truncate a file. + * The ext2/ext3 code never truncates a directory, and files + * stored on the MDS are entirely sparse (no data blocks). + * If we do need to get it, we can do it here. + */ return mds->mds_fsops->fs_setattr(dentry, handle, iattr); } static inline int mds_fs_set_objid(struct mds_obd *mds, struct inode *inode, - void *handle, __u64 id) + void *handle, __u64 id) { return mds->mds_fsops->fs_set_objid(inode, handle, id); } diff --git a/lustre/mds/mds_ext2.c b/lustre/mds/mds_ext2.c index 85e0461..bd75fcd 100644 --- a/lustre/mds/mds_ext2.c +++ b/lustre/mds/mds_ext2.c @@ -38,7 +38,7 @@ static int mds_ext2_setattr(struct dentry *dentry, void *handle, in the block pointers; this data is the object id this will go into an extended attribute at some point. */ - if (iattr->ia_valid & ATTR_SIZE ) { + if (iattr->ia_valid & ATTR_SIZE) { /* ATTR_SIZE would invoke truncate: clear it */ iattr->ia_valid &= ~ATTR_SIZE; inode->i_size = iattr->ia_size; diff --git a/lustre/mds/mds_ext3.c b/lustre/mds/mds_ext3.c index 856bf74..7ebd6a2 100644 --- a/lustre/mds/mds_ext3.c +++ b/lustre/mds/mds_ext3.c @@ -67,7 +67,7 @@ static int mds_ext3_setattr(struct dentry *dentry, void *handle, in the block pointers; this data is the object id this will go into an extended attribute at some point. */ - if ( iattr->ia_valid & ATTR_SIZE ) { + if (iattr->ia_valid & ATTR_SIZE) { /* ATTR_SIZE would invoke truncate: clear it */ iattr->ia_valid &= ~ATTR_SIZE; inode->i_size = iattr->ia_size; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index b8869ba..fb2c6da 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -530,7 +530,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa, out: for (pages = 0, i = 0; i < num_oa; i++) for (j = 0; j < oa_bufs[i]; j++, pages++) - kunmap(buf[n]); + kunmap(buf[pages]); ptlrpc_free_req(request); return 0; diff --git a/lustre/tests/runfailure-net b/lustre/tests/runfailure-net index a8e53c7..8a84b47 100755 --- a/lustre/tests/runfailure-net +++ b/lustre/tests/runfailure-net @@ -14,9 +14,9 @@ test_fail() { mount -t lustre_lite -o device=3 none /mnt/lustre } -mknod /dev/request c 10 244 +[ -c /dev/request ] || mknod /dev/request c 10 244 -sh llmount.sh +echo | sh llmount.sh || exit -1 # GETATTR_NET - ls will hang on the getattr test_fail 0x102 ls -l /mnt/lustre diff --git a/lustre/tests/testreq.c b/lustre/tests/testreq.c index 8580a58..351e506 100644 --- a/lustre/tests/testreq.c +++ b/lustre/tests/testreq.c @@ -54,7 +54,7 @@ int main(int argc, char **argv) { int fd, rc, c, cmd = 0; unsigned long arg; - char *short_opts = "h", *name; + char *short_opts = "h", *name = argv[0]; static struct option long_opts[] = { #define OPT_GETATTR -2 {"getattr", no_argument, NULL, OPT_GETATTR}, @@ -111,8 +111,8 @@ int main(int argc, char **argv) arg = strtoul(optarg, NULL, 0); break; case '?': + default: usage(argv[0], 1); - break; } } while (c != -1); -- 1.8.3.1