On Tue, Jul 22, 2025 at 3:42 PM Bernd Schubert <bschubert@xxxxxxx> wrote: > > This is useful to have a unique API to flush background requests. > For example when the bg queue gets flushed before > the remaining of fuse_conn_destroy(). > > Signed-off-by: Bernd Schubert <bschubert@xxxxxxx> > --- > fs/fuse/dev.c | 2 ++ > fs/fuse/dev_uring.c | 3 +++ > fs/fuse/dev_uring_i.h | 4 ++++ > 3 files changed, 9 insertions(+) > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c > index 5387e4239d6aa6f7a9780deaf581483cc28a5e68..d5f2fb82c04bf1ee7a35cb1d6d43e639270945af 100644 > --- a/fs/fuse/dev.c > +++ b/fs/fuse/dev.c > @@ -2408,6 +2408,8 @@ void fuse_flush_requests(struct fuse_conn *fc, unsigned long timeout) > spin_unlock(&fc->bg_lock); > spin_unlock(&fc->lock); > > + fuse_uring_flush_bg(fc); I think we'll need to get rid of the "WARN_ON_ONCE(ring->fc->max_background != UINT_MAX);" in fuse_uring_flush_bg() since fuse_flush_requests() sets fc->max_background to UINT_MAX a few lines above before making this call. Thanks, Joanne > + > /* > * Wait 30s for all the events to complete or abort. Touch the > * watchdog once per second so that we don't trip the hangcheck timer > diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c > index eca457d1005e7ecb9d220d5092d00cf60961afea..acf11eadbf3b6d999b310b5d8a4a6018e83cb2a9 100644 > --- a/fs/fuse/dev_uring.c > +++ b/fs/fuse/dev_uring.c > @@ -123,6 +123,9 @@ void fuse_uring_flush_bg(struct fuse_conn *fc) > struct fuse_ring_queue *queue; > struct fuse_ring *ring = fc->ring; > > + if (!ring) > + return; > + > for (qid = 0; qid < ring->nr_queues; qid++) { > queue = READ_ONCE(ring->queues[qid]); > if (!queue) > diff --git a/fs/fuse/dev_uring_i.h b/fs/fuse/dev_uring_i.h > index 55f52508de3ced624ac17fba6da1b637b1697dff..ae806dd578f26fbeac12f880cd7b6031a56aec00 100644 > --- a/fs/fuse/dev_uring_i.h > +++ b/fs/fuse/dev_uring_i.h > @@ -206,6 +206,10 @@ static inline bool fuse_uring_request_expired(struct fuse_conn *fc) > return false; > } > > +static inline void fuse_uring_flush_bg(struct fuse_conn *fc) > +{ > +} > + > #endif /* CONFIG_FUSE_IO_URING */ > > #endif /* _FS_FUSE_DEV_URING_I_H */ > > -- > 2.43.0 > >