From a5cac107a16115582b5916f6dbd6a523ff9643bf Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 8 Dec 2016 13:14:45 -0800 Subject: [PATCH] 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 --- kmod/src/seg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kmod/src/seg.c b/kmod/src/seg.c index 4c125f1c..d4eeb32f 100644 --- a/kmod/src/seg.c +++ b/kmod/src/seg.c @@ -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);