On 18.01.22 15:41, Andrew Cooper wrote: > On 16/01/2022 08:33, Juergen Gross wrote: >> diff --git a/blkfront.c b/blkfront.c >> index e3f42bef..ed902702 100644 >> --- a/blkfront.c >> +++ b/blkfront.c >> @@ -483,9 +483,13 @@ int blkfront_aio_poll(struct blkfront_dev *dev) >> >> moretodo: >> #ifdef HAVE_LIBC >> - if (dev->fd != -1) { >> - files[dev->fd].read = false; >> - mb(); /* Make sure to let the handler set read to 1 before we start looking at the ring */ >> + { >> + struct file *file = get_file_from_fd(dev->fd); >> + >> + if ( file ) { > > Style, as this is is being indented. Oh, missed that one. :-( > >> + file->read = false; >> + mb(); /* Make sure to let the handler set read to 1 before we start looking at the ring */ > > MiniOS is in desperate need of being dragged over to LKMM, and to stop > using inappropriate fences.  Things will go much faster when these have > all been corrected to smp barriers. Indeed. Juergen