> > - return atomic_read(&inode->i_dio_count) ? -ERESTARTSYS : 0; > > + inode_dio_wait_interruptible(inode); > > + return !inode_dio_finished(inode) ? -ERESTARTSYS : 0; > > That looks broken. We have a private static function calling an > exported function of the same name. I suspect that this static > function needs to be named "netfs_dio_wait_interruptible()".... Yep. I already fixed that in the tree. > atomic_dec_and_test() is a RMW atomic operation with a return value, > so has has fully ordered semanitcs according to > Documentation/atomic_t.txt: > > - RMW operations that have a return value are fully ordered. > [...] > Fully ordered primitives are ordered against everything prior and everything > subsequent. Therefore a fully ordered primitive is like having an smp_mb() > before and an smp_mb() after the primitive. > > So there's never a need for explicit barriers before/after an > atomic_dec_and_test() operation, right? Thanks for the comments on the barrires. Frankly, I added the barriers because the internal implementation of the wait_*() functions tend to confuse me as they require memory barriers to ensure that wait_var_event() sees the condition fulfilled or waitqueue_active() sees the waiter. And apparently I'm not the only one with that confusion around these apis (see Neil's series).