android_kernel_oneplus_msm8998/fs/9p
piaojun 2c9ffc9d44 fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
commit 3111784bee81591ea2815011688d28b65df03627 upstream.

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 <piaojun@huawei.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 20:04:33 +02:00
..
acl.c 9p: fix a potential acl leak 2017-05-14 13:32:54 +02:00
acl.h
cache.c
cache.h fs: 9p: cache.h: Add #define of include guard 2015-11-11 02:19:50 -05:00
fid.c 9p: switch to %p[dD] 2014-10-09 02:39:04 -04:00
fid.h
Kconfig
Makefile 9p: xattr simplifications 2015-11-13 20:34:33 -05:00
v9fs.c 9p: remove unused option Opt_trans 2015-08-23 14:21:16 -05:00
v9fs.h 9p: don't bother with __getname() in ->follow_link() 2015-05-10 22:18:19 -04:00
v9fs_vfs.h 9p: switch p9_client_read() to passing struct iov_iter * 2015-04-11 22:28:27 -04:00
vfs_addr.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
vfs_dentry.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
vfs_dir.c fs/9p: fix readdir() 2015-04-24 15:45:03 -04:00
vfs_file.c 9p: use file_dentry() 2016-08-10 11:49:27 +02:00
vfs_inode.c fs/9p: Compare qid.path in v9fs_test_inode 2017-11-30 08:37:22 +00:00
vfs_inode_dotl.c fs/9p: Compare qid.path in v9fs_test_inode 2017-11-30 08:37:22 +00:00
vfs_super.c v9fs: fix error handling in v9fs_session_init() 2015-06-08 09:05:06 -06:00
xattr.c fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed 2018-09-09 20:04:33 +02:00
xattr.h 9p: xattr simplifications 2015-11-13 20:34:33 -05:00