Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347642
b: refs/heads/master
c: 2d77bf0
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Nov 12, 2012
1 parent bca4019 commit 66b7c98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2873d2147e1e14b82367bde14354a011ffda0496
refs/heads/master: 2d77bf0a55d64559adb2d48a37bc7e876d6adc11
36 changes: 27 additions & 9 deletions trunk/fs/nfsd/nfs4recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,17 +1064,35 @@ nfsd4_client_tracking_init(struct net *net)
int status;
struct path path;

if (!client_tracking_ops) {
client_tracking_ops = &nfsd4_cld_tracking_ops;
status = kern_path(nfs4_recoverydir(), LOOKUP_FOLLOW, &path);
if (!status) {
if (S_ISDIR(path.dentry->d_inode->i_mode))
client_tracking_ops =
&nfsd4_legacy_tracking_ops;
path_put(&path);
}
/* just run the init if it the method is already decided */
if (client_tracking_ops)
goto do_init;

/*
* First, try a UMH upcall. It should succeed or fail quickly, so
* there's little harm in trying that first.
*/
client_tracking_ops = &nfsd4_umh_tracking_ops;
status = client_tracking_ops->init(net);
if (!status)
return status;

/*
* See if the recoverydir exists and is a directory. If it is,
* then use the legacy ops.
*/
client_tracking_ops = &nfsd4_legacy_tracking_ops;
status = kern_path(nfs4_recoverydir(), LOOKUP_FOLLOW, &path);
if (!status) {
status = S_ISDIR(path.dentry->d_inode->i_mode);
path_put(&path);
if (status)
goto do_init;
}

/* Finally, try to use nfsdcld */
client_tracking_ops = &nfsd4_cld_tracking_ops;
do_init:
status = client_tracking_ops->init(net);
if (status) {
printk(KERN_WARNING "NFSD: Unable to initialize client "
Expand Down

0 comments on commit 66b7c98

Please sign in to comment.