aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsfh.h
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-03-28 22:23:47 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-03-30 10:47:34 -0400
commit2336745e87a646a3dc9570f082b85df519ee523e (patch)
tree70975174a7fe3e0be2f5b07d06590e4190af6865 /fs/nfsd/nfsfh.h
parenta8a7c6776f8d74780348bef639581421d85a4376 (diff)
NFSD: Clear wcc data between compound ops
Testing NFS4.0 by pynfs, I got some messeages as, "nfsd: inode locked twice during operation." When one compound RPC contains two or more ops that locks the filehandle,the second op will cause the message. As two SETATTR ops, after the first SETATTR, nfsd will not call fh_put() to release current filehandle, it means filehandle have unlocked with fh_post_saved = 1. The second SETATTR find fh_post_saved = 1, and printk the message. v2: introduce helper fh_clear_wcc(). Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsfh.h')
-rw-r--r--fs/nfsd/nfsfh.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h
index 4775bc4896c8..ad67964d0bb1 100644
--- a/fs/nfsd/nfsfh.h
+++ b/fs/nfsd/nfsfh.h
@@ -133,6 +133,17 @@ fh_init(struct svc_fh *fhp, int maxsize)
133 133
134#ifdef CONFIG_NFSD_V3 134#ifdef CONFIG_NFSD_V3
135/* 135/*
136 * The wcc data stored in current_fh should be cleared
137 * between compound ops.
138 */
139static inline void
140fh_clear_wcc(struct svc_fh *fhp)
141{
142 fhp->fh_post_saved = 0;
143 fhp->fh_pre_saved = 0;
144}
145
146/*
136 * Fill in the pre_op attr for the wcc data 147 * Fill in the pre_op attr for the wcc data
137 */ 148 */
138static inline void 149static inline void
@@ -152,7 +163,8 @@ fill_pre_wcc(struct svc_fh *fhp)
152 163
153extern void fill_post_wcc(struct svc_fh *); 164extern void fill_post_wcc(struct svc_fh *);
154#else 165#else
155#define fill_pre_wcc(ignored) 166#define fh_clear_wcc(ignored)
167#define fill_pre_wcc(ignored)
156#define fill_post_wcc(notused) 168#define fill_post_wcc(notused)
157#endif /* CONFIG_NFSD_V3 */ 169#endif /* CONFIG_NFSD_V3 */
158 170