From 5444f0504f5d7f2158df7d810128c57aa4916189 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 10 Feb 2004 04:43:13 +0000 Subject: [PATCH] Update b_eq from HEAD (20040209_2123) (1.0.4 landing) --- .../patches/vfs_intent-2.4.18-18-chaos65.patch | 16 ++++++++-------- lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch | 14 +++++++------- lustre/obdfilter/filter_io.c | 14 +++++++++----- lustre/smfs/file.c | 15 ++++++++++++--- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/lustre/kernel_patches/patches/vfs_intent-2.4.18-18-chaos65.patch b/lustre/kernel_patches/patches/vfs_intent-2.4.18-18-chaos65.patch index 2efed4f..e29ae29 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.4.18-18-chaos65.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.4.18-18-chaos65.patch @@ -275,10 +275,10 @@ { struct dentry * result; struct inode *dir = parent->d_inode; -+ int counter = 0; ++ int counter = 0; +again: -+ counter++; ++ counter++; down(&dir->i_sem); /* * First re-do the cached lookup just in case it was created @@ -300,10 +300,10 @@ + if (!result->d_op->d_revalidate_it(result, flags, it) && + !d_invalidate(result)) { + dput(result); -+ if (counter > 10) -+ result = ERR_PTR(-ESTALE); -+ if (!IS_ERR(result)) -+ goto again; ++ if (counter > 10) ++ result = ERR_PTR(-ESTALE); ++ if (!IS_ERR(result)) ++ goto again; + } } return result; @@ -1427,8 +1427,8 @@ { struct inode * inode = dentry->d_inode; - if (inode->i_op && inode->i_op->revalidate) -+ if (!inode) -+ return -ENOENT; ++ if (!inode) ++ return -ENOENT; + if (inode->i_op && inode->i_op->revalidate_it) + return inode->i_op->revalidate_it(dentry, it); + else if (inode->i_op && inode->i_op->revalidate) diff --git a/lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch b/lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch index a632e00..082b8b7 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch @@ -482,11 +482,11 @@ + &dentry->d_name, 0, NULL); + d_invalidate(dentry); + dput(dentry); -+ if (IS_ERR(new)) { -+ err = PTR_ERR(new); -+ break; -+ } -+ nd->dentry = new; ++ if (IS_ERR(new)) { ++ err = PTR_ERR(new); ++ break; ++ } ++ nd->dentry = new; + } + } else if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { @@ -1450,8 +1450,8 @@ { struct inode * inode = dentry->d_inode; - if (inode->i_op && inode->i_op->revalidate) -+ if (!inode) -+ return -ENOENT; ++ if (!inode) ++ return -ENOENT; + if (inode->i_op && inode->i_op->revalidate_it) + return inode->i_op->revalidate_it(dentry, it); + else if (inode->i_op && inode->i_op->revalidate) diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index afb49db..f4581bb 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -244,6 +244,10 @@ static int filter_start_page_write(struct inode *inode, RETURN(lnb->rc = -ENOMEM); } POISON_PAGE(page, 0xf1); + if (lnb->len != PAGE_SIZE) { + memset(kmap(page) + lnb->len, 0, PAGE_SIZE - lnb->len); + kunmap(page); + } page->index = lnb->offset >> PAGE_SHIFT; lnb->page = page; @@ -280,7 +284,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa, memset(res, 0, niocount * sizeof(*res)); push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL); - dentry = filter_fid2dentry(exp->exp_obd, NULL, obj->ioo_gr, + dentry = filter_fid2dentry(exp->exp_obd, NULL, obj->ioo_gr, obj->ioo_id); if (IS_ERR(dentry)) GOTO(cleanup, rc = PTR_ERR(dentry)); @@ -394,7 +398,7 @@ void flip_into_page_cache(struct inode *inode, struct page *new_page) /* the dlm is protecting us from read/write concurrency, so we * expect this find_lock_page to return quickly. even if we * race with another writer it won't be doing much work with - * the page locked. we do this 'cause t_c_p expects a + * the page locked. we do this 'cause t_c_p expects a * locked page, and it wants to grab the pagecache lock * as well. */ old_page = find_lock_page(inode->i_mapping, new_page->index); @@ -412,9 +416,9 @@ void flip_into_page_cache(struct inode *inode, struct page *new_page) /* racing o_directs (no locking ioctl) could race adding * their pages, so we repeat the page invalidation unless * we successfully added our new page */ - rc = add_to_page_cache_unique(new_page, inode->i_mapping, + rc = add_to_page_cache_unique(new_page, inode->i_mapping, new_page->index, - page_hash(inode->i_mapping, + page_hash(inode->i_mapping, new_page->index)); if (rc == 0) { /* add_to_page_cache clears uptodate|dirty and locks @@ -422,7 +426,7 @@ void flip_into_page_cache(struct inode *inode, struct page *new_page) SetPageUptodate(new_page); unlock_page(new_page); } -#else +#else rc = 0; #endif } while (rc != 0); diff --git a/lustre/smfs/file.c b/lustre/smfs/file.c index 455fccd..e9afdd1 100644 --- a/lustre/smfs/file.c +++ b/lustre/smfs/file.c @@ -153,8 +153,9 @@ static ssize_t smfs_write (struct file *filp, const char *buf, &open_file, &open_dentry); if (cache_inode->i_fop->write) - rc = cache_inode->i_fop->write(&open_file, buf, count, ppos); + rc = cache_inode->i_fop->write(&open_file, buf, count, &open_file.f_pos); + *ppos = open_file.f_pos; duplicate_inode(cache_inode, inode); smfs_update_file(filp, &open_file); @@ -191,6 +192,9 @@ static ssize_t smfs_read (struct file *filp, char *buf, { struct inode *cache_inode; struct dentry *dentry = filp->f_dentry; + struct inode *inode = dentry->d_inode; + struct file open_file; + struct dentry open_dentry; ssize_t rc; ENTRY; @@ -199,10 +203,15 @@ static ssize_t smfs_read (struct file *filp, char *buf, if (!cache_inode) RETURN(-ENOENT); + smfs_prepare_cachefile(inode, filp, cache_inode, + &open_file, &open_dentry); + if (cache_inode->i_fop->read) - rc = cache_inode->i_fop->read(filp, buf, count, ppos); + rc = cache_inode->i_fop->read(&open_file, buf, count, &open_file.f_pos); - duplicate_inode(cache_inode, dentry->d_inode); + *ppos = open_file.f_pos; + duplicate_inode(cache_inode, inode); + smfs_update_file(filp, &open_file); RETURN(rc); } -- 1.8.3.1