aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/direct.c6
-rw-r--r--fs/nfs/inode.c5
-rw-r--r--fs/nfs/internal.h2
-rw-r--r--fs/nfs/nfs4client.c2
4 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 10bf07280f4a..294692ff83b1 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -212,6 +212,12 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq,
212 */ 212 */
213ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos) 213ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
214{ 214{
215 struct inode *inode = iocb->ki_filp->f_mapping->host;
216
217 /* we only support swap file calling nfs_direct_IO */
218 if (!IS_SWAPFILE(inode))
219 return 0;
220
215#ifndef CONFIG_NFS_SWAP 221#ifndef CONFIG_NFS_SWAP
216 dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n", 222 dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n",
217 iocb->ki_filp, (long long) pos, iter->nr_segs); 223 iocb->ki_filp, (long long) pos, iter->nr_segs);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 4bffe637ea32..2211f6ba8736 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -352,8 +352,9 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st
352 352
353 nfs_attr_check_mountpoint(sb, fattr); 353 nfs_attr_check_mountpoint(sb, fattr);
354 354
355 if (((fattr->valid & NFS_ATTR_FATTR_FILEID) == 0) && 355 if (nfs_attr_use_mounted_on_fileid(fattr))
356 !nfs_attr_use_mounted_on_fileid(fattr)) 356 fattr->fileid = fattr->mounted_on_fileid;
357 else if ((fattr->valid & NFS_ATTR_FATTR_FILEID) == 0)
357 goto out_no_inode; 358 goto out_no_inode;
358 if ((fattr->valid & NFS_ATTR_FATTR_TYPE) == 0) 359 if ((fattr->valid & NFS_ATTR_FATTR_TYPE) == 0)
359 goto out_no_inode; 360 goto out_no_inode;
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index efaa31c70fbe..b6f34bfa6fe8 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -31,8 +31,6 @@ static inline int nfs_attr_use_mounted_on_fileid(struct nfs_fattr *fattr)
31 (((fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT) == 0) && 31 (((fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT) == 0) &&
32 ((fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) == 0))) 32 ((fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) == 0)))
33 return 0; 33 return 0;
34
35 fattr->fileid = fattr->mounted_on_fileid;
36 return 1; 34 return 1;
37} 35}
38 36
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 953daa44a282..706ad10b8186 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -639,7 +639,7 @@ int nfs41_walk_client_list(struct nfs_client *new,
639 prev = pos; 639 prev = pos;
640 640
641 status = nfs_wait_client_init_complete(pos); 641 status = nfs_wait_client_init_complete(pos);
642 if (status == 0) { 642 if (pos->cl_cons_state == NFS_CS_SESSION_INITING) {
643 nfs4_schedule_lease_recovery(pos); 643 nfs4_schedule_lease_recovery(pos);
644 status = nfs4_wait_clnt_recover(pos); 644 status = nfs4_wait_clnt_recover(pos);
645 } 645 }