Thread (3 messages) 3 messages, 2 authors, 2012-08-01

Re: [PATCH] Btrfs: unlock extent when the dio completes for reads

From: Zach Brown <hidden>
Date: 2012-07-31 21:30:51

+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?

- z
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help