Bug 216010

Summary: kafs client don't notice that file has changed when using "git status"
Product: File System Reporter: Markus Suvanto (markus.suvanto)
Component: OtherAssignee: fs_other
Status: RESOLVED CODE_FIX    
Severity: normal CC: dhowells
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.18.0-rc7 Subsystem:
Regression: No Bisected commit-id:

Description Markus Suvanto 2022-05-20 20:19:01 UTC
Reproducer:

1) openafs client:
cd /afs/station.com/tmp 
mkdir foo
cd foo
git init
echo "hello" > hello.txt
git add hello.txt
git commit -m "hello"

git status
On branch master
nothing to commit, working tree clean

2) kafs client:
cd /afs/station.com/tmp/foo

git status
On branch master
nothing to commit, working tree clean

3) openafs client:
echo hello2 >> hello.txt
git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   hello.txt


4) kafs client:

git status
On branch master
nothing to commit, working tree clean


But after I use that file, for example
cat hello.txt 
hello
hello2

git status

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   hello.txt
Comment 1 David Howells 2022-05-20 20:49:16 UTC
What kernel version are you using?
Comment 2 Markus Suvanto 2022-05-20 20:53:08 UTC
uname -a
Linux test.station.com 5.18.0-rc7
Comment 3 David Howells 2022-05-24 09:22:37 UTC
This should be fixed by:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2aeb8c86d49967552394d5e723f87454cb53f501

afs: Fix afs_getattr() to refetch file status if callback break occurred