From fe6340e2d1f5ef9ebb9a82665b053c362837cbd6 Mon Sep 17 00:00:00 2001 From: Souptick Joarder Date: Tue, 17 Jul 2018 19:14:35 -0700 Subject: fs/9p/vfs_file.c: use new return type vm_fault_t Use new return type vm_fault_t for page_mkwrite handler. See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Link: http://lkml.kernel.org/r/20180702154928.GA3964@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Acked-by: Jun Piao Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet --- fs/9p/vfs_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/9p') diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 03c9e325bfbc..5f2e48d41d72 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -533,7 +533,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma) return retval; } -static int +static vm_fault_t v9fs_vm_page_mkwrite(struct vm_fault *vmf) { struct v9fs_inode *v9inode; -- cgit v1.2.3 From 6baaac096179e7f49b7c3d1bc7785d7cd88215ee Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 17 Jul 2018 19:14:49 -0700 Subject: fs/9p/v9fs.c: fix spelling mistake "Uknown" -> "Unknown" fix spelling mistake in pr_info message text Link: http://lkml.kernel.org/r/20180526150650.10562-1-colin.king@canonical.com Signed-off-by: Colin Ian King Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet --- fs/9p/v9fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/9p') diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 0429c8ee58f1..89bac3d2f05b 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -343,7 +343,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) v9ses->uid = make_kuid(current_user_ns(), uid); if (!uid_valid(v9ses->uid)) { ret = -EINVAL; - pr_info("Uknown uid %s\n", s); + pr_info("Unknown uid %s\n", s); } } -- cgit v1.2.3 From 3111784bee81591ea2815011688d28b65df03627 Mon Sep 17 00:00:00 2001 From: piaojun Date: Wed, 25 Jul 2018 11:13:16 +0800 Subject: fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed In my testing, v9fs_fid_xattr_set will return successfully even if the backend ext4 filesystem has no space to store xattr key-value. That will cause inconsistent behavior between front end and back end. The reason is that lsetxattr will be triggered by p9_client_clunk, and unfortunately we did not catch the error. This patch will catch the error to notify upper caller. p9_client_clunk (in 9p) p9_client_rpc(clnt, P9_TCLUNK, "d", fid->fid); v9fs_clunk (in qemu) put_fid free_fid v9fs_xattr_fid_clunk v9fs_co_lsetxattr s->ops->lsetxattr ext4_xattr_user_set (in host ext4 filesystem) Link: http://lkml.kernel.org/r/5B57EACC.2060900@huawei.com Signed-off-by: Jun Piao Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Cc: Andrew Morton Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet --- fs/9p/xattr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fs/9p') diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index f329eee6dc93..352abc39e891 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c @@ -105,7 +105,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, { struct kvec kvec = {.iov_base = (void *)value, .iov_len = value_len}; struct iov_iter from; - int retval; + int retval, err; iov_iter_kvec(&from, WRITE | ITER_KVEC, &kvec, 1, value_len); @@ -126,7 +126,9 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, retval); else p9_client_write(fid, 0, &from, &retval); - p9_client_clunk(fid); + err = p9_client_clunk(fid); + if (!retval && err) + retval = err; return retval; } -- cgit v1.2.3