From: "Luís Henriques" <lhenriques@suse.de>
To: xiubli@redhat.com
Cc: jlayton@kernel.org, idryomov@gmail.com, vshankar@redhat.com,
pdonnell@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: flush the dirty caps immediatelly when quota is approaching
Date: Thu, 23 Jun 2022 11:44:34 +0100 [thread overview]
Message-ID: <87pmizk6b1.fsf@brahms.olymp> (raw)
In-Reply-To: <20220623095238.874126-1-xiubli@redhat.com> (xiubli@redhat.com's message of "Thu, 23 Jun 2022 17:52:38 +0800")
xiubli@redhat.com writes:
> From: Xiubo Li <xiubli@redhat.com>
>
> When the quota is approaching we need to notify it to the MDS as
> soon as possible, or the client could write to the directory more
> than expected.
>
> This will flush the dirty caps without delaying after each write,
> though this couldn't prevent the real size of a directory exceed
> the quota but could prevent it as soon as possible.
Nice, looks good. Unfortunately, the real problem can't probably be
solved without a complete re-design of the cephfs quotas. Oh well...
Reviewed-by: Luís Henriques <lhenriques@suse.de>
Cheers,
--
Luís
>
> URL: https://tracker.ceph.com/issues/56180
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
> fs/ceph/caps.c | 5 +++--
> fs/ceph/file.c | 5 +++--
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index c7163afdc71a..511d1963aa09 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -1979,14 +1979,15 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
> }
>
> dout("check_caps %llx.%llx file_want %s used %s dirty %s flushing %s"
> - " issued %s revoking %s retain %s %s%s\n", ceph_vinop(inode),
> + " issued %s revoking %s retain %s %s%s%s\n", ceph_vinop(inode),
> ceph_cap_string(file_wanted),
> ceph_cap_string(used), ceph_cap_string(ci->i_dirty_caps),
> ceph_cap_string(ci->i_flushing_caps),
> ceph_cap_string(issued), ceph_cap_string(revoking),
> ceph_cap_string(retain),
> (flags & CHECK_CAPS_AUTHONLY) ? " AUTHONLY" : "",
> - (flags & CHECK_CAPS_FLUSH) ? " FLUSH" : "");
> + (flags & CHECK_CAPS_FLUSH) ? " FLUSH" : "",
> + (flags & CHECK_CAPS_NOINVAL) ? " NOINVAL" : "");
>
> /*
> * If we no longer need to hold onto old our caps, and we may
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index debc1748ccdf..0eb4a02175ad 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -1960,7 +1960,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
> if (dirty)
> __mark_inode_dirty(inode, dirty);
> if (ceph_quota_is_max_bytes_approaching(inode, iocb->ki_pos))
> - ceph_check_caps(ci, 0, NULL);
> + ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
> }
>
> dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n",
> @@ -2577,7 +2577,8 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off,
> /* Let the MDS know about dst file size change */
> if (ceph_inode_set_size(dst_inode, dst_off) ||
> ceph_quota_is_max_bytes_approaching(dst_inode, dst_off))
> - ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY, NULL);
> + ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_FLUSH,
> + NULL);
> }
> /* Mark Fw dirty */
> spin_lock(&dst_ci->i_ceph_lock);
> --
>
> 2.36.0.rc1
>
next prev parent reply other threads:[~2022-06-23 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 9:52 [PATCH] ceph: flush the dirty caps immediatelly when quota is approaching xiubli
2022-06-23 10:44 ` Luís Henriques [this message]
2022-06-23 12:15 ` Xiubo Li
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=87pmizk6b1.fsf@brahms.olymp \
--to=lhenriques@suse.de \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=pdonnell@redhat.com \
--cc=vshankar@redhat.com \
--cc=xiubli@redhat.com \
/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.