ceph: print more information when we can't find snaprealm during ceph_add_cap
PATCH 1/1 ceph: print more information when we can't find snaprealm during ceph_add_cap
Print a bit more information when we can't find the realm during ceph_add_cap. Show both the inode number and the old realm inode number.
URL: https://tracker.ceph.com/issues/46419
Suggested-by Sage Weil <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- fs/ceph/caps.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
fs/ceph/caps.c +5 -6
@@ -703,13 +703,12 @@ void ceph_add_cap(struct inode *inode,*/ struct ceph_snap_realm *realm =ceph_lookup_snap_realm (mdsc, realmino); -if (realm) { +if (realm)ceph_change_snap_realm (inode, realm); - }else { -pr_err ("ceph_add_cap: couldn't find snap realm %llx\n" , - realmino); -WARN_ON (!realm); - } +else +WARN ("ceph_add_cap: couldn't find snap realm 0x%llx (ino 0x%llx oldrealm 0x%llx)\n" , + realmino, ci->vino.ino, + ci->i_snap_realm ? ci->i_snap_realm->ino :0 ); }__check_cap_issue (ci, cap, issued);
Signature · 1 line
2.31.1
Quoted 24 lines · Jeff Layton
Print a bit more information when we can't find the realm during
ceph_add_cap. Show both the inode number and the old realm inode number.URL: https://tracker.ceph.com/issues/46419
Suggested-by Sage Weil <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/ceph/caps.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)fs/ceph/caps.c +1
-3@@ -703,13 +703,12 @@ void ceph_add_cap(struct inode *inode,*/ struct ceph_snap_realm *realm =ceph_lookup_snap_realm (mdsc, realmino); -if (realm) { +if (realm)ceph_change_snap_realm (inode, realm); - }else { - pr_err("ceph_add_cap: couldn't find snap realm %llx\n",
fs/ceph/caps.c void ceph_add_cap(struct inode *inode, · line 714
Quoted 10 lines
fs/ceph/caps.c +4
-3- realmino); -WARN_ON (!realm); - } +else +WARN ("ceph_add_cap: couldn't find snap realm 0x%llx (ino 0x%llx oldrealm 0x%llx)\n" , + realmino, ci->vino.ino, + ci->i_snap_realm ? ci->i_snap_realm->ino :0 ); }__check_cap_issue (ci, cap, issued);
Doh! I sent a broken version of this patch.
The first argument to warn is the condition so this should read "WARN(1, "ceph_add_cap...". The version in testing branch is correct.
Sorry for the noise!
Signature · 1 line
Jeff Layton <[email protected]>