Message ID | 20110826201910.GB17196@fieldses.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 08/26/2011 01:19 PM, J. Bruce Fields wrote: > On Fri, Aug 12, 2011 at 05:30:12PM -0700, Boaz Harrosh wrote: <snip> > @@ -156,12 +155,14 @@ out_put: > dput(dentry); > out_unlock: > mutex_unlock(&dir->d_inode->i_mutex); > - if (status == 0) { > - clp->cl_firststate = 1; > + if (status == 0) > vfs_fsync(rec_file, 0); > - } > + else > + printk(KERN_ERR "NFSD: failed to write recovery record" > + " (err %d); please check that recovery" > + " directory exists and is writeable", > + status); Bruce Hi Which of the variables has the directory path? Would we like to add that information in the print. From my experience alot of times those type of problems is the mis-communication of the path names, and it helps to see what name was actually attempted. Other wise looks good Thanks > nfs4_reset_creds(original_cred); > - dprintk("NFSD: nfsd4_create_clid_dir returns %d\n", status); > return status; > } > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Aug 26, 2011 at 05:22:56PM -0700, Boaz Harrosh wrote: > Which of the variables has the directory path? > Would we like to add that information in the print. From my experience > alot of times those type of problems is the mis-communication of > the path names, and it helps to see what name was actually attempted. Yeah, I wanted to then realized I'd have to muck about with some other stuff to get access to the directory name. Curse these patch reviewers, catching me being lazy. --b. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 02eb38e..1ea241a 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -129,6 +129,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) if (!rec_file || clp->cl_firststate) return 0; + clp->cl_firststate = 1; status = nfs4_save_creds(&original_cred); if (status < 0) return status; @@ -143,10 +144,8 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) goto out_unlock; } status = -EEXIST; - if (dentry->d_inode) { - dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); + if (dentry->d_inode) goto out_put; - } status = mnt_want_write(rec_file->f_path.mnt); if (status) goto out_put; @@ -156,12 +155,14 @@ out_put: dput(dentry); out_unlock: mutex_unlock(&dir->d_inode->i_mutex); - if (status == 0) { - clp->cl_firststate = 1; + if (status == 0) vfs_fsync(rec_file, 0); - } + else + printk(KERN_ERR "NFSD: failed to write recovery record" + " (err %d); please check that recovery" + " directory exists and is writeable", + status); nfs4_reset_creds(original_cred); - dprintk("NFSD: nfsd4_create_clid_dir returns %d\n", status); return status; }