All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] Btrfs: fix unprotected extent map operation when logging file extents
@ 2012-11-01  7:34 Miao Xie
  2012-11-01  8:14 ` Liu Bo
  0 siblings, 1 reply; 2+ messages in thread
From: Miao Xie @ 2012-11-01  7:34 UTC (permalink / raw)
  To: Linux Btrfs

We forget to protect the modified_extents list, fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/tree-log.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index cbb544e..f7e9387 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3525,8 +3525,10 @@ next_slot:
 		struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree;
 		struct extent_map *em, *n;
 
+		write_lock(&tree->lock);
 		list_for_each_entry_safe(em, n, &tree->modified_extents, list)
 			list_del_init(&em->list);
+		write_unlock(&tree->lock);
 	}
 
 	if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5] Btrfs: fix unprotected extent map operation when logging file extents
  2012-11-01  7:34 [PATCH 4/5] Btrfs: fix unprotected extent map operation when logging file extents Miao Xie
@ 2012-11-01  8:14 ` Liu Bo
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Bo @ 2012-11-01  8:14 UTC (permalink / raw)
  To: Miao Xie; +Cc: Linux Btrfs

On Thu, Nov 01, 2012 at 03:34:54PM +0800, Miao Xie wrote:
> We forget to protect the modified_extents list, fix it.
> 

Looks good to me.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

thanks,
liubo

> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
>  fs/btrfs/tree-log.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index cbb544e..f7e9387 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -3525,8 +3525,10 @@ next_slot:
>  		struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree;
>  		struct extent_map *em, *n;
>  
> +		write_lock(&tree->lock);
>  		list_for_each_entry_safe(em, n, &tree->modified_extents, list)
>  			list_del_init(&em->list);
> +		write_unlock(&tree->lock);
>  	}
>  
>  	if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
> -- 
> 1.7.6.5
> --
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-01  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01  7:34 [PATCH 4/5] Btrfs: fix unprotected extent map operation when logging file extents Miao Xie
2012-11-01  8:14 ` Liu Bo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.