mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
nfsd: use ATTR_CTIME_SET for delegated ctime updates
Ensure that notify_change() doesn't clobber a delegated ctime update
with current_time() by setting ATTR_CTIME_SET for those updates.
Don't bother setting the timestamps in cb_getattr_update_times() in the
non-delegated case. notify_change() will do that itself.
Fixes: 7e13f4f8d2 ("nfsd: handle delegated timestamps in SETATTR")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
afc5b36e29
commit
c066ff58e5
|
|
@ -9167,7 +9167,6 @@ static bool set_cb_time(struct timespec64 *cb, const struct timespec64 *orig,
|
|||
static int cb_getattr_update_times(struct dentry *dentry, struct nfs4_delegation *dp)
|
||||
{
|
||||
struct inode *inode = d_inode(dentry);
|
||||
struct timespec64 now = current_time(inode);
|
||||
struct nfs4_cb_fattr *ncf = &dp->dl_cb_fattr;
|
||||
struct iattr attrs = { };
|
||||
int ret;
|
||||
|
|
@ -9175,6 +9174,7 @@ static int cb_getattr_update_times(struct dentry *dentry, struct nfs4_delegation
|
|||
if (deleg_attrs_deleg(dp->dl_type)) {
|
||||
struct timespec64 atime = inode_get_atime(inode);
|
||||
struct timespec64 mtime = inode_get_mtime(inode);
|
||||
struct timespec64 now = current_time(inode);
|
||||
|
||||
attrs.ia_atime = ncf->ncf_cb_atime;
|
||||
attrs.ia_mtime = ncf->ncf_cb_mtime;
|
||||
|
|
@ -9183,12 +9183,12 @@ static int cb_getattr_update_times(struct dentry *dentry, struct nfs4_delegation
|
|||
attrs.ia_valid |= ATTR_ATIME | ATTR_ATIME_SET;
|
||||
|
||||
if (set_cb_time(&attrs.ia_mtime, &mtime, &now)) {
|
||||
attrs.ia_valid |= ATTR_CTIME | ATTR_MTIME | ATTR_MTIME_SET;
|
||||
attrs.ia_valid |= ATTR_CTIME | ATTR_CTIME_SET |
|
||||
ATTR_MTIME | ATTR_MTIME_SET;
|
||||
attrs.ia_ctime = attrs.ia_mtime;
|
||||
}
|
||||
} else {
|
||||
attrs.ia_valid |= ATTR_MTIME | ATTR_CTIME;
|
||||
attrs.ia_mtime = attrs.ia_ctime = now;
|
||||
}
|
||||
|
||||
if (!attrs.ia_valid)
|
||||
|
|
|
|||
|
|
@ -539,7 +539,8 @@ nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen,
|
|||
iattr->ia_mtime.tv_nsec = modify.nseconds;
|
||||
iattr->ia_ctime.tv_sec = modify.seconds;
|
||||
iattr->ia_ctime.tv_nsec = modify.nseconds;
|
||||
iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME | ATTR_MTIME_SET | ATTR_DELEG;
|
||||
iattr->ia_valid |= ATTR_CTIME | ATTR_CTIME_SET |
|
||||
ATTR_MTIME | ATTR_MTIME_SET | ATTR_DELEG;
|
||||
}
|
||||
|
||||
/* request sanity: did attrlist4 contain the expected number of words? */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user