linux/fs/9p
piaojun bd531ebf15 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>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-12-16 22:08:43 +00:00
..
acl.c posix_acl: Clear SGID bit when setting file permissions 2016-11-20 01:17:38 +00: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 9p: remove unused 'p9_fid' struct pointer 2013-11-23 16:10:31 -06:00
cache.h 9p: make v9fs_cache_inode_{get,put,set}_cookie empty inlines for !9P_CACHEFS 2013-10-24 23:34:47 -04:00
fid.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-03-03 13:23:03 -08:00
fid.h 9p: v9fs_fid_add() can't fail now 2013-02-28 01:18:14 -05:00
Kconfig fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
Makefile fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
v9fs.c fs/9p/v9fs.c: add __init to v9fs_sysfs_init 2014-06-04 16:53:55 -07:00
v9fs.h 9P: introduction of a new cache=mmap model. 2014-01-10 09:20:51 -06:00
v9fs_vfs.h 9P: introduction of a new cache=mmap model. 2014-01-10 09:20:51 -06:00
vfs_addr.c pass iov_iter to ->direct_IO() 2014-05-06 17:32:44 -04:00
vfs_dentry.c consolidate simple ->d_delete() instances 2013-11-15 22:04:17 -05:00
vfs_dir.c fs/9p: kerneldoc fixes 2014-06-04 16:53:55 -07:00
vfs_file.c mm: drop vm_ops->remap_pages and generic_file_remap_pages() stub 2018-10-03 04:09:51 +01:00
vfs_inode.c fs/9p: Compare qid.path in v9fs_test_inode 2018-02-13 18:42:09 +00:00
vfs_inode_dotl.c fs/9p: Compare qid.path in v9fs_test_inode 2018-02-13 18:42:09 +00:00
vfs_super.c 9P: introduction of a new cache=mmap model. 2014-01-10 09:20:51 -06:00
xattr.c fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed 2018-12-16 22:08:43 +00:00
xattr.h fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
xattr_security.c fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
xattr_trusted.c fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
xattr_user.c fs/9p: Add support user. xattr 2010-08-02 14:28:35 -05:00