[LU-3868] lockless IO does not update inode timestamps Created: 30/Aug/13  Updated: 20/May/14  Resolved: 20/May/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.0
Fix Version/s: Lustre 2.6.0, Lustre 2.5.2

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: osc, patch

Issue Links:
Related
is related to LU-3832 osc_io_read_start() ignores O_NOATIME... Closed
Severity: 3
Rank (Obsolete): 10036

 Description   

In osc_io_read_start() and osc_io_write_start() if the lockless IO bit is set in the osc_io then the inode timestamps are not updated by the IO. Is there any reason for this?

In osc_io_write_start() we have the following unnecessary attr get before we set the m- and c-times?

                result = cl_object_attr_get(env, obj, attr);
                if (result == 0) {
			attr->cat_mtime = attr->cat_ctime =
                                LTIME_S(CFS_CURRENT_TIME);
                        result = cl_object_attr_set(env, obj, attr,
                                                    CAT_MTIME | CAT_CTIME);
                }


 Comments   
Comment by John Hammond [ 30/Aug/13 ]

Vladimir and Vitaly, I see that you wrote and inspected this code. Could you explain why we would not update timestamps for lockless IO?

Comment by Vitaly Fertman [ 03/Sep/13 ]

timestamps cached on client, as well as other attributes, have no sense without locks, so no need to set it for lockless IO, client just passes attributes to server.
if there is a raced locked IO, its lock will be cancelled by server-side lock taken by lockless IO and next attempt of acquiring a lock will bring proper attributes on client.
btw, it concerns truncate as well.

Comment by Andreas Dilger [ 04/Sep/13 ]

There is no requirement that the server clocks are in sync with the client clocks, so all file timestamps should be generated by the client. In the case of lockless IO, there should be a timestamp update sent by the client with each RPC, regardless of whether it is cached under a DLM lock by the client or not.

Comment by Swapnil Pimpale (Inactive) [ 10/Jan/14 ]

Patch: http://review.whamcloud.com/8797

Comment by Peter Jones [ 20/May/14 ]

Landed for 2.5.2 and 2.6

Generated at Sat Feb 10 01:37:36 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.