> -----Original Message----- > From: David Sterba [mailto:dsterba@xxxxxxx] > Sent: Wednesday, August 08, 2018 12:19 AM > To: Lu, Fengqi/陆 丰麒 <lufq.fnst@xxxxxxxxxxxxxx> > Cc: linux-btrfs@xxxxxxxxxxxxxxx; Gu, Jinxiang/顾 金香 <gujx@xxxxxxxxxxxxxx> > Subject: Re: [PATCH 2/5] btrfs: use a separate variable to store the num_bytes of the qgroup_reserve > > On Sat, Aug 04, 2018 at 09:10:54PM +0800, Lu Fengqi wrote: > > After btrfs_qgroup_reserve_meta_prealloc(), num_bytes will be assigned > > again by btrfs_calc_trans_metadata_size(). Therefore, once block_rsv > > fails, we cannot properly free the num_bytes of the previous > > qgroup_reserve. > > This does not look like a trivial cleanup at all. There was an unused > parameter, removed in c4c129db5da8f070147f175 ("btrfs: drop unused > parameter qgroup_reserved"), that introduced the bug. Yes. It was introduced by fix above. I missed the second assignment of num_bytes. And it should use two variable to record reserve size of qgroup and blockgroup. >This was in this > rc1 so it's a regression and I'll consider pushing it to the 4.18 final. > ?韬{.n?????%??檩??w?{.n???{饼?~镶?^n?■???h?璀?{?夸z罐?+€?zf"?????i?????_璁?:+v??撸?
