2018-06-05 14:10 GMT+02:00 David Sterba <dsterba@xxxxxxx>: > On Mon, Jun 04, 2018 at 09:31:16PM +0200, Andreas Gruenbacher wrote: >> @@ -1062,8 +1063,9 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, >> if (ret < 0) >> iomap_dio_set_error(dio, ret); >> + /* + * Make sure changes to dio are visible globally before the atomic + * counter decrement. + */ >> + smp_mb__before_atomic(); >> if (!atomic_dec_and_test(&dio->ref)) { > > The barrier should be documented. I tried to do a quick look around the > code if it's clear why it's there but it's not. Thanks. > >> - if (!is_sync_kiocb(iocb)) >> + if (!dio->wait_for_completion) >> return -EIOCBQUEUED; >> >> for (;;) { Thanks, Andreas