[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <41baed4e-279c-6074-b2b8-d8972bdb8859@suse.com>
Date: Wed, 17 Apr 2019 11:15:05 +0300
From: Nikolay Borisov <nborisov@...e.com>
To: Pan Bian <bianpan2016@....com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>
Cc: linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: btrfs: drop inode reference count on error path
On 17.04.19 г. 5:23 ч., Pan Bian wrote:
> The reference count of inode is incremented by ihold. It should be
> dropped if not used. However, the reference count is not dropped if
> error occurs during updating the inode or deleting orphan items. This
> patch fixes the bug.
>
> Signed-off-by: Pan Bian <bianpan2016@....com>
The extra reference count taken is needed for the call to d_instantiate,
while this operation is in progress the inode is actually locked. This
means it will be a lot clearer if ihold is done right before
d_instantiate and they are moved at the end of the function where we are
sure no errors have appened. Something like the attached diff
View attachment "btrfs-link-cleanup.diff" of type "text/x-patch" (2342 bytes)
Powered by blists - more mailing lists