Skip to content

Commit 3647e42

Browse files
committed
afs: Fix over zealous "vnode modified" warnings
Occasionally, warnings like this: vnode modified 2af7 on {10000b:1} [exp 2af2] YFS.FetchStatus(vnode) are emitted into the kernel log. This indicates that when we were applying the updated vnode (file) status retrieved from the server to an inode we saw that the data version number wasn't what we were expecting (in this case it's 0x2af7 rather than 0x2af2). We've usually received a callback from the server prior to this point - or the callback promise has lapsed - so the warning is merely informative and the state is to be expected. Fix this by only emitting the warning if the we still think that we have a valid callback promise and haven't received a callback. Also change the format slightly so so that the new data version doesn't look like part of the text, the like is prefixed with "kAFS: " and the message is ranked as a warning. Fixes: 31143d5 ("AFS: implement basic file write support") Reported-by: Ian Wienand <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent a188339 commit 3647e42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fs/afs/inode.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,13 @@ static void afs_apply_status(struct afs_fs_cursor *fc,
207207

208208
if (expected_version &&
209209
*expected_version != status->data_version) {
210-
kdebug("vnode modified %llx on {%llx:%llu} [exp %llx] %s",
211-
(unsigned long long) status->data_version,
212-
vnode->fid.vid, vnode->fid.vnode,
213-
(unsigned long long) *expected_version,
214-
fc->type ? fc->type->name : "???");
210+
if (test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags))
211+
pr_warn("kAFS: vnode modified {%llx:%llu} %llx->%llx %s\n",
212+
vnode->fid.vid, vnode->fid.vnode,
213+
(unsigned long long)*expected_version,
214+
(unsigned long long)status->data_version,
215+
fc->type ? fc->type->name : "???");
216+
215217
vnode->invalid_before = status->data_version;
216218
if (vnode->status.type == AFS_FTYPE_DIR) {
217219
if (test_and_clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags))

0 commit comments

Comments
 (0)