From 9f545782fb32b14e310a20129b80364ac786ddff Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 21 Jun 2017 16:40:47 -0700 Subject: [PATCH] scoutfs: add missing segment put Back when we changed the transaction commit to ask the server to update the commit we accidentally lost the put of the level0 segment that was just written. This leaked refcount would pin segments over time and eventually drag the box into crippling oom. Signed-off-by: Zach Brown --- kmod/src/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kmod/src/trans.c b/kmod/src/trans.c index 4c41de88..bfa82f57 100644 --- a/kmod/src/trans.c +++ b/kmod/src/trans.c @@ -112,7 +112,7 @@ void scoutfs_trans_write_func(struct work_struct *work) struct super_block *sb = sbi->sb; DECLARE_TRANS_INFO(sb, tri); struct scoutfs_bio_completion comp; - struct scoutfs_segment *seg; + struct scoutfs_segment *seg = NULL; u64 segno; int ret = 0; @@ -138,6 +138,7 @@ void scoutfs_trans_write_func(struct work_struct *work) scoutfs_bio_wait_comp(sb, &comp) ?: scoutfs_net_record_segment(sb, seg, 0) ?: scoutfs_net_advance_seq(sb, &sbi->trans_seq); + scoutfs_seg_put(seg); if (ret) goto out;