This really seems like the wrong approach to me. Is this callback going to be synchronous or async? Imagine you get a bunch of caps recalled all at once (or the client decides to voluntarily return them for whatever reason). Either you have to issue these invalidations synchronously in some fashion, or you have a window where you've returned caps but ganesha still has cached attributes that it's operating on.
You could mitigate the synchronous nature by creating a way to invalidate them in batches, but that's really complex. If you go with an async notification then that's potentially racy, especially once we start considering tossing pnfs into the mix.
I think it would be better to not have ganesha cache anything by default between RPCs. The exception there would be to allow it to cache things when it has a delegation.
Now, that said...Frank was doing some experimentation with disabling caches on ganesha+ceph last week and saw a perf hit on a readdir test. It's still early days there though, and I think that may just be an indicator that the ceph userland client could use some optimization. The single giant client mutex is pretty gross...
I'm open-minded here if someone can convince me that multiple layers of caching is beneficial, but I'm just not seeing the benefit to the complexity right now. Multi-layer caching problems are a real pain to sort out.