linux-brain/fs/9p
piaojun 684f5d9a1d fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
commit 3111784bee 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:01:20 +02:00
..
acl.c 9p: fix a potential acl leak 2017-05-14 14:00:13 +02:00
acl.h 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 2013-02-26 02:46:07 -05:00
cache.c fs/9p: use fscache mutex rather than spinlock 2016-01-09 02:57:21 -05:00
cache.h fs: 9p: cache.h: Add #define of include guard 2015-11-11 02:19:50 -05:00
fid.c 9p: use clone_fid() 2016-08-03 11:12:12 -04:00
fid.h 9p: use clone_fid() 2016-08-03 11:12:12 -04:00
Kconfig fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
Makefile 9p: xattr simplifications 2015-11-13 20:34:33 -05:00
v9fs_vfs.h 9p: switch p9_client_read() to passing struct iov_iter * 2015-04-11 22:28:27 -04:00
v9fs.c kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00
v9fs.h fs: make remaining filesystems use .rename2 2016-09-27 11:03:58 +02:00
vfs_addr.c missed comment updates from ->direct_IO() prototype change 2016-05-29 19:05:03 -04:00
vfs_dentry.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
vfs_dir.c 9p: switch to ->iterate_shared() 2016-05-09 11:41:16 -04:00
vfs_file.c 9p: use file_dentry() 2016-06-30 23:28:09 -04:00
vfs_inode_dotl.c fs/9p: Compare qid.path in v9fs_test_inode 2017-11-30 08:39:05 +00:00
vfs_inode.c fs/9p: Compare qid.path in v9fs_test_inode 2017-11-30 08:39:05 +00:00
vfs_super.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
xattr.c fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed 2018-09-09 20:01:20 +02:00
xattr.h 9p: xattr simplifications 2015-11-13 20:34:33 -05:00