ceph: fix setting of xattrs on async created inodes
authorJeff Layton <jlayton@kernel.org>
Mon, 25 Apr 2022 19:54:27 +0000 (15:54 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 May 2022 08:26:55 +0000 (10:26 +0200)
commit8c09cb115e9f444b154d76b00d3035dc8e297bed
tree533cd9e93d2485a6f7e0ab4c0ba8cbfa6c21585c
parent73e12d4d33bcf04fc076382492d1cc56b77cd6af
ceph: fix setting of xattrs on async created inodes

commit 620239d9a32e9fe27c9204ec11e40058671aeeb6 upstream.

Currently when we create a file, we spin up an xattr buffer to send
along with the create request. If we end up doing an async create
however, then we currently pass down a zero-length xattr buffer.

Fix the code to send down the xattr buffer in req->r_pagelist. If the
xattrs span more than a page, however give up and don't try to do an
async create.

Cc: stable@vger.kernel.org
URL: https://bugzilla.redhat.com/show_bug.cgi?id=2063929
Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
Reported-by: John Fortin <fortinj66@gmail.com>
Reported-by: Sri Ramanujam <sri@ramanujam.io>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/file.c