summaryrefslogtreecommitdiffstats
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@primarydata.com>2015-12-05 15:57:31 +0800
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-12-28 14:32:37 -0500
commit0bcbf039f6b2bcefe4f5dada76079080edf9ecd0 (patch)
tree8edf8f581dcd12258d7ab84898261a3a3d0ab2ef /fs/nfs/internal.h
parent2bff2288579f1e4af2f05a7f7443c85b7766d5ac (diff)
downloadlinux-0bcbf039f6b2bcefe4f5dada76079080edf9ecd0.tar.bz2
nfs: handle request add failure properly
When we fail to queue a read page to IO descriptor, we need to clean it up otherwise it is hanging around preventing nfs module from being removed. When we fail to queue a write page to IO descriptor, we need to clean it up and also save the failure status to open context. Then at file close, we can try to write pages back again and drop the page if it fails to writeback in .launder_page, which will be done in the next patch. Signed-off-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 313d55402238..68f773dc226e 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -711,3 +711,17 @@ static inline u32 nfs_stateid_hash(nfs4_stateid *stateid)
return 0;
}
#endif
+
+static inline bool nfs_error_is_fatal(int err)
+{
+ switch (err) {
+ case -ERESTARTSYS:
+ case -EIO:
+ case -ENOSPC:
+ case -EROFS:
+ case -E2BIG:
+ return true;
+ default:
+ return false;
+ }
+}