Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1656146
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Arnd Bergmann <arnd@arndb.de> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() |
| Date | Fri, 02 Jun 2017 13:40:01 +0200 |
| Message-ID | <tNT5T-rX-7@gated-at.bofh.it> (permalink) |
| References | <ttN33-6YE-3@gated-at.bofh.it> <ttN35-6YE-23@gated-at.bofh.it> <tNv3A-Uw-13@gated-at.bofh.it> <tNvwB-1jB-13@gated-at.bofh.it> <tNIDv-1yO-7@gated-at.bofh.it> <tNINc-1BX-7@gated-at.bofh.it> <tNJ6y-1N8-7@gated-at.bofh.it> <tNKlX-2SE-1@gated-at.bofh.it> <tNRnr-7G9-15@gated-at.bofh.it> <tNRQt-87W-3@gated-at.bofh.it> <tNStb-8qp-13@gated-at.bofh.it> <tNSMx-kN-3@gated-at.bofh.it> |
| X-Original-To | "Yan, Zheng" <ukernel@gmail.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GD5Iy1pOdA4/tKIm27thvWj6vzHfiAIDh1iuUCPU8h0=; b=XTNLdv1NEYzuJ1QXXqtSVowGWlrJ0CwRsJuLXOw/Rs9kx4snhzBZwlMqWA5K8S/9nQ R6JMRJn9yBFtr5J3RpvRFTqL0oPH1GqZ5FdCM5XNI+X5Eczt8RHCwGflo8616PoFK9Nj oKC7tzutWtsYSlDeLANBKgdzy4G4Jv92ofN3wYt3AsHohzRFSgd+mLQJPvGk0zKUUC5R oW7hDcK8hTjtZ4hwZjxoEv16PzRBXu1Nm1KqBpWZgWddafefLAs4g0Va+R92BplHNZqT iOAPByuUPdZiKwC+8263M5iOwuShhgGvquWC2pylLNrJjAlMJfbdUMo37KOv+PTiAQM0 jbyw== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GD5Iy1pOdA4/tKIm27thvWj6vzHfiAIDh1iuUCPU8h0=; b=NHFSsp8qSQnOJFOJ79MoJ7l+VHvLe+oevDzASzIedQggqaBmOBCEOU9sU6kdll9eRH 6XdOcs4+1NFazIGQRCd91Kkx4guYAsAQ1J+SSuiQF1TU0nYyAWCRRZdamOuQ3UKvFQzq 2Z/DFcyyhAicqLUEx3H1r+VFAkj0qezwKyq6zuRua6mO5x6eUhGm0B3rCCZGFvRqXTIj 4LcFuE+cMc3OCbm1R2wZ+MDO2pdS5m9OQTPSmHQ9dAFfXZgA+J5GN/XDb0p/pUo2oUPG R/oWXZqyqS/YkVjq/rwHYdWgeObxq6JlwBP21KUQdDLi+hKKl7MShnrmv5uYzYYC+zoS 6cpg== |
| X-Gm-Message-State | AODbwcDbQxUs24ynagXiVJlOrbqZRCRUa83uxmFSu2wYlxobS0raB6Er Olx9s7EwF/Yg469oo6AkNSEtAIrAhA== |
| X-Received | by 10.157.16.110 with SMTP id o43mr4331661oto.71.1496403212628; Fri, 02 Jun 2017 04:33:32 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Google-Sender-Auth | Z_wkaLOSCvMQmI4Xdg7U1Y-loZw |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 64 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Deepa Dinamani <deepa.kernel@gmail.com>, John Stultz <john.stultz@linaro.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Thomas Gleixner <tglx@linutronix.de>, Al Viro <viro@zeniv.linux.org.uk>, gregkh <gregkh@linuxfoundation.org>, "Dilger, Andreas" <andreas.dilger@intel.com>, "J. Bruce Fields" <bfields@fieldses.org>, Chris Mason <clm@fb.com>, David Miller <davem@davemloft.net>, David Sterba <dsterba@suse.com>, Evgeniy Dushistov <dushistov@mail.ru>, Eric Paris <eparis@redhat.com>, Jaegeuk Kim <jaegeuk@kernel.org>, Josef Bacik <jbacik@fb.com>, Jeff Layton <jlayton@poochiereds.net>, James Simmons <jsimmons@infradead.org>, Ingo Molnar <mingo@redhat.com>, "Drokin, Oleg" <oleg.drokin@intel.com>, Paul Moore <paul@paul-moore.com>, Steven Rostedt <rostedt@goodmis.org>, yuchao0@huawei.com, ceph-devel <ceph-devel@vger.kernel.org>, devel@driverdev.osuosl.org, linux-audit@redhat.com, linux-btrfs <linux-btrfs@vger.kernel.org>, linux-cifs@vger.kernel.org, "Linux F2FS DEV, Mailing List" <linux-f2fs-devel@lists.sourceforge.net>, Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>, linux-mtd <linux-mtd@lists.infradead.org>, LSM List <linux-security-module@vger.kernel.org>, Lustre Development List <lustre-devel@lists.lustre.org>, Networking <netdev@vger.kernel.org>, samba-technical@lists.samba.org, y2038 Mailman List <y2038@lists.linaro.org> |
| X-Original-Date | Fri, 2 Jun 2017 13:33:32 +0200 |
| X-Original-Message-ID | <CAK8P3a3m3nt6rfvAvDG6HFuUvy+qWbmk5K0UtLGqYhYHOfdF8w@mail.gmail.com> |
| X-Original-References | <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> <CAAM7YAmp=cZKqGHa8UqDnrQLCe+6TKx+7w9SDZv4cW5fr4dfvA@mail.gmail.com> <CAK8P3a1pCw1Oo-Wg70kH5L12pbtEzGDfaPZ8g6ErERJjvY8znQ@mail.gmail.com> <CAAM7YAnWLUXMOCVbgfdKGfvK04EtAQcz-ETm7xFO=8Y=_fCvOQ@mail.gmail.com> <CALAqxLV-yVKWM5es7fAFiDzhSQmtZFiZDPQwBRUYbWUtqhoWVg@mail.gmail.com> <CABeXuvqvLr6sSGF+rZEXXxpCBDKTOeLX1ObSjbPPY4aFBuwvMg@mail.gmail.com> <CAAM7YAkXNo_69tOrw6a5kpyref9nEpEp-2vxBbFVSHGmAVbt+A@mail.gmail.com> <CAK8P3a1TwkVRCwDWqgYE8Z3wZT2+v6xayq=dVeW8KaHmO0W4cg@mail.gmail.com> <CAAM7YA=BJHFLz_Ud==7L=yCzxj+1sjctc68tvpNogPhiSxxELQ@mail.gmail.com> <CAK8P3a0D3EXuwBj+sSVL9cmpysdvQWXnkE0zEctBJS8XOqhX7A@mail.gmail.com> <CAAM7YAk8JNU=XV=sOCczagWjBimO4JSPU08th7E4u6FTJN--9A@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1656146 |
Show key headers only | View raw
On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng <ukernel@gmail.com> wrote:
> On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng <ukernel@gmail.com> wrote:
>>> On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>>>> On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng <ukernel@gmail.com> wrote:
>>>>> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>>>>>> On Thu, Jun 1, 2017 at 5:36 PM, John Stultz <john.stultz@linaro.org> wrote:
>>>>>>> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng <ukernel@gmail.com> wrote:
>>>>
>>>> I believe the bug you see is the result of the two timestamps
>>>> currently being almost guaranteed to be different in the latest
>>>> kernels.
>>>> Changing r_stamp to use current_kernel_time() will make it the
>>>> same value most of the time (as it was before Deepa's patch),
>>>> but when the timer interrupt happens between the timestamps,
>>>> the two are still different, it's just much harder to hit.
>>>>
>>>> I think the proper solution should be to change __ceph_setattr()
>>>> in a way that has req->r_stamp always synchronized with i_ctime.
>>>> If we copy i_ctime to r_stamp, that will also take care of the
>>>> future issues with the planned changes to current_time().
>>>>
>>> I already have a patch
>>> https://github.com/ceph/ceph-client/commit/24f54cd18e195a002ee3d2ab50dbc952fd9f82af
>>
>> Looks good to me. In case anyone cares:
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>>>> The part I don't understand is what else r_stamp (i.e. the time
>>>> stamp in ceph_msg_data with type==
>>>> CEPH_MSG_CLIENT_REQUEST) is used for, other than setting
>>>> ctime in CEPH_MDS_OP_SETATTR.
>>>>
>>>> Will this be used to update the stored i_ctime for other operations
>>>> too? If so, we would need to synchronize it with the in-memory
>>>> i_ctime for all operations that do this.
>>>>
>>>
>>> yes, mds uses it to update ctime of modified inodes. For example,
>>> when handling mkdir, mds set ctime of both parent inode and new inode
>>> to r_stamp.
>>
>> I see, so we may have a variation of that problem there as well: From
>> my reading of the code, the child inode is not in memory yet, so
>> that seems fine, but I could not find where the parent in-memory inode
>> i_ctime is updated in ceph, but it is most likely not the same as
>> req->r_stamp (assuming it gets updated at all).
>
> i_ctime is updated when handling request reply, by ceph_fill_file_time().
> __ceph_setattr() can update the in-memory inode's ctime after request
> reply is received. The difference between ktime_get_real_ts() and
> current_time() can be larger than round-trip time of request. So it's
> still possible that __ceph_setattr() make ctime go back.
But the __ceph_setattr() problem should be fixed by your patch, right?
What I meant is another related problem in ceph_mkdir() where the
i_ctime field of the parent inode is different between the persistent
representation in the mds and the in-memory representation.
Arnd
>> Would it make sense require all callers of ceph_mdsc_do_request()
>> to update r_stamp at the same time as i_ctime to keep them in sync?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-01 12:00 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Arnd Bergmann <arnd@arndb.de> - 2017-06-01 12:30 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 02:30 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() John Stultz <john.stultz@linaro.org> - 2017-06-02 02:40 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Deepa Dinamani <deepa.kernel@gmail.com> - 2017-06-02 03:00 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 04:20 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Arnd Bergmann <arnd@arndb.de> - 2017-06-02 11:50 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 12:20 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Arnd Bergmann <arnd@arndb.de> - 2017-06-02 13:00 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 13:20 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Arnd Bergmann <arnd@arndb.de> - 2017-06-02 13:40 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 14:20 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() Arnd Bergmann <arnd@arndb.de> - 2017-06-02 16:20 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-04 10:00 +0200
Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() "Yan, Zheng" <ukernel@gmail.com> - 2017-06-02 02:40 +0200
csiph-web