All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <ukernel@gmail.com>
To: majianpeng <majianpeng@gmail.com>
Cc: sage <sage@inktank.com>, ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH] ceph:Update the file time after mmap-write.
Date: Thu, 11 Jul 2013 09:42:38 +0800	[thread overview]
Message-ID: <CAAM7YA=3stCqYppd6YAwk9tC_rHMzraqge_L6gGZkzaG8LH6Ag@mail.gmail.com> (raw)
In-Reply-To: <201307110917146231510@gmail.com>

On Thu, Jul 11, 2013 at 9:17 AM, majianpeng <majianpeng@gmail.com> wrote:
> Although, mmap-write of ceph update the time of file using
> file_update_time.Because it don't mark the relative cap so the time
> can't save.

I think cephfs' mmap IO support is still broken. mmap IO does not respect
ceph capabilities at all. It's possible that the kclient has no Fw cap when
ceph_page_mkwrite is called.

Yan, Zheng


>
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  fs/ceph/addr.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 38b5c1b..52f7c7c 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1231,10 +1231,18 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
>
>         ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
>         if (ret == 0) {
> +               int dirty;
> +               struct ceph_inode_info *ci = ceph_inode(inode);
>                 /* success.  we'll keep the page locked. */
>                 set_page_dirty(page);
>                 up_read(&mdsc->snap_rwsem);
>                 ret = VM_FAULT_LOCKED;
> +
> +               spin_lock(&ci->i_ceph_lock);
> +               dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
> +               spin_unlock(&ci->i_ceph_lock);
> +               if (dirty)
> +                       __mark_inode_dirty(inode, dirty);
>         } else {
>                 if (ret == -ENOMEM)
>                         ret = VM_FAULT_OOM;
> --
> 1.8.1.2

  reply	other threads:[~2013-07-11  1:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11  1:17 [PATCH] ceph:Update the file time after mmap-write majianpeng
2013-07-11  1:42 ` Yan, Zheng [this message]
2013-07-11  1:49   ` majianpeng
2013-07-11  7:53   ` majianpeng
2013-07-11  9:03     ` Yan, Zheng
2013-07-12  2:26       ` majianpeng
2013-07-12  2:46       ` Gregory Farnum
2013-07-12  3:16         ` Yan, Zheng

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='CAAM7YA=3stCqYppd6YAwk9tC_rHMzraqge_L6gGZkzaG8LH6Ag@mail.gmail.com' \
    --to=ukernel@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    --cc=sage@inktank.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.