All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <idryomov@gmail.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Ceph Development <ceph-devel@vger.kernel.org>,
	Dan van der Ster <dan@vanderster.com>
Subject: Re: [PATCH] ceph: set pool_ns in new inode layout for async creates
Date: Wed, 26 Jan 2022 17:23:04 +0100	[thread overview]
Message-ID: <CAOi1vP-W=k=dAmMoXCfQ4McyyP-boRYCdUF6HthCNyfgbOzNWw@mail.gmail.com> (raw)
In-Reply-To: <20220125211022.114286-1-jlayton@kernel.org>

On Tue, Jan 25, 2022 at 10:10 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Dan reported that he was unable to write to files that had been
> asynchronously created when the client's OSD caps are restricted to a
> particular namespace.
>
> The issue is that the layout for the new inode is only partially being
> filled. Ensure that we populate the pool_ns_data and pool_ns_len in the
> iinfo before calling ceph_fill_inode.
>
> Reported-by: Dan van der Ster <dan@vanderster.com>
> Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/file.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index cbe4d5a5cde5..efea321ff643 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -599,6 +599,7 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
>         struct ceph_inode_info *ci = ceph_inode(dir);
>         struct inode *inode;
>         struct timespec64 now;
> +       struct ceph_string *pool_ns;
>         struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb);
>         struct ceph_vino vino = { .ino = req->r_deleg_ino,
>                                   .snap = CEPH_NOSNAP };
> @@ -648,11 +649,17 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
>         in.max_size = cpu_to_le64(lo->stripe_unit);
>
>         ceph_file_layout_to_legacy(lo, &in.layout);
> +       pool_ns = ceph_try_get_string(lo->pool_ns);
> +       if (pool_ns) {
> +               iinfo.pool_ns_len = pool_ns->len;
> +               iinfo.pool_ns_data = pool_ns->str;
> +       }

Considering that we have a reference from try_prep_async_create(), do
we actually need to bother with ceph_try_get_string() here?

Thanks,

                Ilya

  reply	other threads:[~2022-01-26 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 21:10 [PATCH] ceph: set pool_ns in new inode layout for async creates Jeff Layton
2022-01-26 16:23 ` Ilya Dryomov [this message]
2022-01-26 16:34   ` Jeff Layton
2022-01-26 16:46     ` Ilya Dryomov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOi1vP-W=k=dAmMoXCfQ4McyyP-boRYCdUF6HthCNyfgbOzNWw@mail.gmail.com' \
    --to=idryomov@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dan@vanderster.com \
    --cc=jlayton@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.