Commit e4636d53 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: minor nfsd_vfs_write cleanup

There's no need to check host_err >= 0 every time here when we could
check host_err < 0 once, following the usual kernel style.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent d911df7b
...@@ -1053,19 +1053,20 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, ...@@ -1053,19 +1053,20 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
oldfs = get_fs(); set_fs(KERNEL_DS); oldfs = get_fs(); set_fs(KERNEL_DS);
host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset); host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
set_fs(oldfs); set_fs(oldfs);
if (host_err >= 0) { if (host_err < 0)
*cnt = host_err; goto out_nfserr;
nfsdstats.io_write += host_err; *cnt = host_err;
fsnotify_modify(file->f_path.dentry); nfsdstats.io_write += host_err;
} fsnotify_modify(file->f_path.dentry);
/* clear setuid/setgid flag after write */ /* clear setuid/setgid flag after write */
if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) if (inode->i_mode & (S_ISUID | S_ISGID))
kill_suid(dentry); kill_suid(dentry);
if (host_err >= 0 && stable && use_wgather) if (stable && use_wgather)
host_err = wait_for_concurrent_writes(file); host_err = wait_for_concurrent_writes(file);
out_nfserr:
dprintk("nfsd: write complete host_err=%d\n", host_err); dprintk("nfsd: write complete host_err=%d\n", host_err);
if (host_err >= 0) if (host_err >= 0)
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment