Commit 6e176d47 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4: Fixes for nfs4_inode_return_delegation()



We mustn't call nfs_wb_all() on anything other than a regular file.
Furthermore, we can exit early when we don't hold a delegation.

Reported-by: default avatarDavid Wysochanski <dwysocha@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent f0caea88
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -755,11 +755,13 @@ int nfs4_inode_return_delegation(struct inode *inode)
	struct nfs_delegation *delegation;

	delegation = nfs_start_delegation_return(nfsi);
	if (delegation != NULL) {
		/* Synchronous recall of any application leases */
		break_lease(inode, O_WRONLY | O_RDWR);
		if (S_ISREG(inode->i_mode))
			nfs_wb_all(inode);
	if (delegation != NULL)
		return nfs_end_delegation_return(inode, delegation, 1);
	}
	return 0;
}