From 156ecb2d8b06589098f6ce3012e6a10fef07c416 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 20 May 2011 17:00:01 +0000 Subject: [PATCH] [CIFS] Fix to problem with getattr caused by invalidate simplification patch Fix to earlier "Simplify invalidate part (try #6)" patch That patch caused problems with connectathon test 5. Reviewed-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/cifsfs.c | 6 ++++-- fs/cifs/inode.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index ed92c7d36378..493b74ca5648 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -617,8 +617,10 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) if (!CIFS_I(inode)->clientCanCacheRead && inode->i_mapping && inode->i_mapping->nrpages != 0) { rc = filemap_fdatawait(inode->i_mapping); - mapping_set_error(inode->i_mapping, rc); - return rc; + if (rc) { + mapping_set_error(inode->i_mapping, rc); + return rc; + } } /* * Some applications poll for the file length in this strange diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 0cc7eddb077f..de02ed5e25c2 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1805,8 +1805,10 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, if (!CIFS_I(inode)->clientCanCacheRead && inode->i_mapping && inode->i_mapping->nrpages != 0) { rc = filemap_fdatawait(inode->i_mapping); - mapping_set_error(inode->i_mapping, rc); - return rc; + if (rc) { + mapping_set_error(inode->i_mapping, rc); + return rc; + } } rc = cifs_revalidate_dentry_attr(dentry); -- 2.20.1