> From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> > Sent: Monday, January 22, 2024 11:08 PM > To: yuanlinyu <yuanlinyu@xxxxxxxxxxx> > Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; > linux-usb@xxxxxxxxxxxxxxx > Subject: Re: [PATCH v1] usb: f_mass_storage: forbid async queue when > shutdown happen > > > --- a/drivers/usb/gadget/function/f_mass_storage.c > > +++ b/drivers/usb/gadget/function/f_mass_storage.c > > @@ -545,21 +545,41 @@ static int start_transfer(struct fsg_dev *fsg, struct > usb_ep *ep, > > > > This could be written more cleanly as: > > rc = start_transfer(common->fsg, common->fsg->bulk_in, bh->inreq); > if (rc) { > bh->state = BUF_STATE_EMPTY; > if (rc == -ESHUTDOWN) { > common->running = 0; > return false; > } > } > return true; Sure, will send v2. > > And the same goes for start_out_transfer(). > > Have you tested this? Does it do what you want? Yes, test the change, before the change, there are many logs, now only one time. > > Alan Stern