From: David Sterba <dsterba@suse.cz>
To: Filipe Manana <fdmanana@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] Btrfs: send, don't leave without decrementing clone root's send_progress
Date: Mon, 9 Mar 2015 17:45:51 +0100 [thread overview]
Message-ID: <20150309164551.GH5841@twin.jikos.cz> (raw)
In-Reply-To: <1425329633-5059-2-git-send-email-fdmanana@suse.com>
On Mon, Mar 02, 2015 at 08:53:53PM +0000, Filipe Manana wrote:
> If the clone root was not readonly or the dead flag was set on it, we were
> leaving without decrementing the root's send_progress counter (and before
> we just incremented it). If a concurrent snapshot deletion was in progress
> and ended up being aborted, it would be impossible to later attempt to
> delete again the snapshot, since the root's send_in_progress counter could
> never go back to 0.
>
> We were also setting clone_sources_to_rollback to i + 1 too early - if we
> bailed out because the clone root we got is not readonly or flagged as dead
> we ended up later derreferencing a null pointer because we didn't assign
> the clone root to sctx->clone_roots[i].root:
>
> for (i = 0; sctx && i < clone_sources_to_rollback; i++)
> btrfs_root_dec_send_in_progress(
> sctx->clone_roots[i].root);
>
> So just don't increment the send_in_progress counter if the root is readonly
> or flagged as dead.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
next prev parent reply other threads:[~2015-03-09 16:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 20:53 [PATCH 1/2] Btrfs: send, add missing check for dead clone root Filipe Manana
2015-03-02 20:53 ` [PATCH 2/2] Btrfs: send, don't leave without decrementing clone root's send_progress Filipe Manana
2015-03-09 16:45 ` David Sterba [this message]
2015-03-09 16:43 ` [PATCH 1/2] Btrfs: send, add missing check for dead clone root David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150309164551.GH5841@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox