Set END_IO on allocated segs

A reader that hits an allocated segment would wait on IO forever.
Setting the end_io bit lets readers use written segments.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-12-08 13:14:45 -08:00
parent f9ca1885f9
commit a5cac107a1

View File

@@ -232,6 +232,9 @@ int scoutfs_seg_alloc(struct super_block *sb, struct scoutfs_segment **seg_ret)
goto out;
}
/* reads shouldn't wait for this */
set_bit(SF_END_IO, &seg->flags);
/* XXX always remove existing segs, is that necessary? */
spin_lock_irqsave(&cac->lock, flags);
atomic_inc(&seg->refcount);