]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfsd/vfs.h
HID: sensors: fix up for mfd_add_devices() API change
[karo-tx-linux.git] / fs / nfsd / vfs.h
index ec0611b2b738468fbc261b35f2190048680e67dd..359594c393d273f20b5fe3ef0a9a75379ab1edc2 100644 (file)
@@ -110,12 +110,19 @@ int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
 
 static inline int fh_want_write(struct svc_fh *fh)
 {
-       return mnt_want_write(fh->fh_export->ex_path.mnt);
+       int ret = mnt_want_write(fh->fh_export->ex_path.mnt);
+
+       if (!ret)
+               fh->fh_want_write = 1;
+       return ret;
 }
 
 static inline void fh_drop_write(struct svc_fh *fh)
 {
-       mnt_drop_write(fh->fh_export->ex_path.mnt);
+       if (fh->fh_want_write) {
+               fh->fh_want_write = 0;
+               mnt_drop_write(fh->fh_export->ex_path.mnt);
+       }
 }
 
 #endif /* LINUX_NFSD_VFS_H */