Content-Type: multipart/mixed; boundary="===============4966874394191484958==" MIME-Version: 1.0 From: Nikolay Borisov To: kbuild-all@lists.01.org Subject: Re: [kbuild] Re: [PATCH 2/2] btrfs: Use btrfs_try_lock_balance in btrfs_ioctl_balance Date: Wed, 04 May 2022 11:44:51 +0300 Message-ID: <82030643-9b19-1422-6fed-dae04abad165@suse.com> In-Reply-To: <202205041423.NVVJIHSj-lkp@intel.com> List-Id: --===============4966874394191484958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 4.05.22 =D0=B3. 9:46 =D1=87., Dan Carpenter wrote: > Hi Nikolay, > = > url: https://github.com/intel-lab-lkp/linux/commits/Nikolay-Borisov/Re= factor-btrfs_ioctl_balance/20220503-163837 > base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git = for-next > config: i386-randconfig-m021-20220502 (https://download.01.org/0day-ci/ar= chive/20220504/202205041423.NVVJIHSj-lkp(a)intel.com/config ) > compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > Reported-by: Dan Carpenter > = > smatch warnings: > fs/btrfs/ioctl.c:4493 btrfs_ioctl_balance() error: double free of 'bargs' > = > vim +/bargs +4493 fs/btrfs/ioctl.c Yep, a genuine braino, the fix is to remove either of the calls. I = personally would go with the one before mnt_drop_write so that we drop = the write ASAP but in the end I doubt it makes any practical difference. = David care to fold this or shall I resend? > = > c9e9f97bdfb64d Ilya Dryomov 2012-01-16 4484 > 0f89abf56abbd0 Christian Engelmayer 2015-10-21 4485 kfree(bctl); > ed0fb78fb6aa29 Ilya Dryomov 2013-01-20 4486 out_unlock: > c9e9f97bdfb64d Ilya Dryomov 2012-01-16 4487 mutex_unlock(&fs_i= nfo->balance_mutex); > ed0fb78fb6aa29 Ilya Dryomov 2013-01-20 4488 if (need_unlock) > c3e1f96c37d0f8 Goldwyn Rodrigues 2020-08-25 4489 btrfs_exclop_fini= sh(fs_info); > ed0fb78fb6aa29 Ilya Dryomov 2013-01-20 4490 out: > c696e46e6ec2b3 Nikolay Borisov 2022-05-03 4491 kfree(bargs); > ^^^^^ > = > e54bfa31044d60 Liu Bo 2012-06-29 4492 mnt_drop_write_fil= e(file); > c746db1b6ed99f Nikolay Borisov 2022-03-30 @4493 kfree(bargs); > ^^^^^ > = > Freed twice. > = > c9e9f97bdfb64d Ilya Dryomov 2012-01-16 4494 return ret; > c9e9f97bdfb64d Ilya Dryomov 2012-01-16 4495 } >=20 --===============4966874394191484958==--