Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quincy: src/mds: increment directory inode's change attr by one #48520

Merged
merged 3 commits into from Feb 17, 2023

Conversation

ajarr
Copy link
Contributor

@ajarr ajarr commented Oct 18, 2022

backport tracker: https://tracker.ceph.com/issues/57879


backport of #48241
parent tracker: https://tracker.ceph.com/issues/57210

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

Alternate operations that only change directory's ctime
(setattr/setxattr/removexattr on directory) with those that change
directory's mtime and ctime (create/rename/remove a file within
directory). Check that directory's change_attr is updated everytime
ctime changes.

Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit d597100)
... whenever the mtime or ctime of the directory inode is modified.

In CephFS subvolume clones exported using NFS-Ganesha, newly created
files using `touch` were not being listed. It was identified that the
create request sent to the Ceph MDS via NFS-Ganesha's libcephfs client
modified the mtime and ctime of the parent directory, but did not modify
the change_attr of the parent directory. Since the NFS client
didn't see a modification of the change attribute in the reply, it
didn't invalidate its readdir cache. The subsequent directory `ls` was
satisfied from the NFS client's stale readdir cache.

Whenever parent directory inode's  mtime was modified in
MDCache::predirty_journal_parents(), the parent inode's change_attr
was set to its dirstat->change_attr. The parent inode's
dirstat->change_attr doesn't track changes to parent's *ctime only*
changes such as setattr, setvxattr, etc. on the parent
directory. See commit 0d441dc for more
details. This caused the directory inode's change_attr to not be updated
when an operation to change only its ctime was followed by an operation
to change its mtime and ctime.

Fix this by making changes to MDCache::predirty_journal_parents() and
CInode::finish_scatter_gather_update() to increment the directory
inode's change_attr by one instead of setting it to its
dirstat->change_attr.

Fixes: https://tracker.ceph.com/issues/57210
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit 05fdd6c)
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit f02b777)
@ajarr ajarr added this to the quincy milestone Oct 18, 2022
@ajarr ajarr added the cephfs Ceph File System label Oct 18, 2022
@github-actions github-actions bot added the tests label Oct 18, 2022
@ajarr ajarr requested a review from vshankar October 18, 2022 02:14
@ajarr
Copy link
Contributor Author

ajarr commented Oct 19, 2022

jenkins test make check

@joscollin
Copy link
Member

jenkins test windows

1 similar comment
@joscollin
Copy link
Member

jenkins test windows

@yuriw yuriw merged commit 666c6c8 into ceph:quincy Feb 17, 2023
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants