On Tue, Jul 31, 2012 at 03:30:49PM -0600, Zach Brown wrote: > > +static void btrfs_direct_read_iodone(struct kiocb *iocb, loff_t offset, > > + ssize_t bytes, void *private, int ret, > > + bool is_async) > > +{ > > + struct inode *inode = iocb->ki_filp->f_mapping->host; > > + u64 lockend; > > + > > + if (get_state_private(&BTRFS_I(inode)->io_tree, offset, &lockend)) { > > + WARN_ON(1); > > + goto out; > > + } > > + > > + unlock_extent(&BTRFS_I(inode)->io_tree, offset, lockend); > > +out: > > + if (is_async) > > + aio_complete(iocb, ret, 0); > > + inode_dio_done(inode); > > +} > > Hmm. I'm worried that this can be called from interrupt context and the > state/extent calls there seem to use bare spin locks. Did you run this > with lockdep? Am I confused? >
Our read completions are run in a helper thread since we need to do things like clear the extent state stuff and such so it's safe in this regard. Course I hit a lockup with xfstests 91 because there are some cases where we can return errors without doing the dio complete (rightly so since we haven't setup the dio yet), so now I have to figure out how to know when we've been unlocked via dio complete or that I've gotten an error back and already unlocked it... Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html