All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: take ordered root lock when removing ordered operations inode
@ 2013-10-28 13:15 Josef Bacik
  2013-10-29 14:33 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2013-10-28 13:15 UTC (permalink / raw)
  To: linux-btrfs

A user reported a list corruption warning from btrfs_remove_ordered_extent, it
is because we aren't taking the ordered_root_lock when we remove the inode from
the ordered operations list.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
---
 fs/btrfs/ordered-data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index bbb1a38..8a5eff3 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -537,7 +537,9 @@ void btrfs_remove_ordered_extent(struct inode *inode,
 	 */
 	if (RB_EMPTY_ROOT(&tree->tree) &&
 	    !mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY)) {
+		spin_lock(&root->fs_info->ordered_root_lock);
 		list_del_init(&BTRFS_I(inode)->ordered_operations);
+		spin_unlock(&root->fs_info->ordered_root_lock);
 	}
 
 	if (!root->nr_ordered_extents) {
-- 
1.8.3.1


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

* Re: [PATCH] Btrfs: take ordered root lock when removing ordered operations inode
  2013-10-28 13:15 [PATCH] Btrfs: take ordered root lock when removing ordered operations inode Josef Bacik
@ 2013-10-29 14:33 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2013-10-29 14:33 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs

On Mon, Oct 28, 2013 at 09:15:14AM -0400, Josef Bacik wrote:
> A user reported a list corruption warning from btrfs_remove_ordered_extent, it
> is because we aren't taking the ordered_root_lock when we remove the inode from
> the ordered operations list.  Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: David Sterba <dsterba@suse.cz>

For stable; it's been there since day 1.

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

end of thread, other threads:[~2013-10-29 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-28 13:15 [PATCH] Btrfs: take ordered root lock when removing ordered operations inode Josef Bacik
2013-10-29 14:33 ` David Sterba

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.