* [PATCH] Btrfs: fix leak subvol subv_writers conter
@ 2016-10-07 2:01 robbieko
2017-01-30 19:56 ` Filipe Manana
0 siblings, 1 reply; 2+ messages in thread
From: robbieko @ 2016-10-07 2:01 UTC (permalink / raw)
To: linux-btrfs; +Cc: Robbie Ko
From: Robbie Ko <robbieko@synology.com>
In run_delalloc_nocow, maybe not release subv_writers conter,
will lead to create snapshot hang.
Signed-off-by: Robbie Ko <robbieko@synology.com>
---
fs/btrfs/inode.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e6811c4..9722554 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1386,11 +1386,17 @@ next_slot:
* this ensure that csum for a given extent are
* either valid or do not exist.
*/
- if (csum_exist_in_range(root, disk_bytenr, num_bytes))
+ if (csum_exist_in_range(root, disk_bytenr, num_bytes)) {
+ if (!nolock)
+ btrfs_end_write_no_snapshoting(root);
goto out_check;
+ }
if (!btrfs_inc_nocow_writers(root->fs_info,
- disk_bytenr))
+ disk_bytenr)) {
+ if (!nolock)
+ btrfs_end_write_no_snapshoting(root);
goto out_check;
+ }
nocow = 1;
} else if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
extent_end = found_key.offset +
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: fix leak subvol subv_writers conter
2016-10-07 2:01 [PATCH] Btrfs: fix leak subvol subv_writers conter robbieko
@ 2017-01-30 19:56 ` Filipe Manana
0 siblings, 0 replies; 2+ messages in thread
From: Filipe Manana @ 2017-01-30 19:56 UTC (permalink / raw)
To: robbieko; +Cc: linux-btrfs@vger.kernel.org
On Fri, Oct 7, 2016 at 3:01 AM, robbieko <robbieko@synology.com> wrote:
> From: Robbie Ko <robbieko@synology.com>
>
> In run_delalloc_nocow, maybe not release subv_writers conter,
> will lead to create snapshot hang.
>
> Signed-off-by: Robbie Ko <robbieko@synology.com>
I've picked this into my integration branch for 4.11 and rewrote the
changelog and subject.
Thanks.
> ---
> fs/btrfs/inode.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index e6811c4..9722554 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1386,11 +1386,17 @@ next_slot:
> * this ensure that csum for a given extent are
> * either valid or do not exist.
> */
> - if (csum_exist_in_range(root, disk_bytenr, num_bytes))
> + if (csum_exist_in_range(root, disk_bytenr, num_bytes)) {
> + if (!nolock)
> + btrfs_end_write_no_snapshoting(root);
> goto out_check;
> + }
> if (!btrfs_inc_nocow_writers(root->fs_info,
> - disk_bytenr))
> + disk_bytenr)) {
> + if (!nolock)
> + btrfs_end_write_no_snapshoting(root);
> goto out_check;
> + }
> nocow = 1;
> } else if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> extent_end = found_key.offset +
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Filipe David Manana,
"People will forget what you said,
people will forget what you did,
but people will never forget how you made them feel."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-30 19:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-07 2:01 [PATCH] Btrfs: fix leak subvol subv_writers conter robbieko
2017-01-30 19:56 ` Filipe Manana
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).