]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Btrfs: fix warning of free_extent_map
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 15 Mar 2013 14:46:39 +0000 (08:46 -0600)
committerChris Mason <chris.mason@fusionio.com>
Sat, 16 Mar 2013 01:51:49 +0000 (21:51 -0400)
commit3b2775942d6ccb14342f3aae55f22fbbfea8db14
treeb17632b7df40dc9892eb3a562b0eaa385143a808
parent7c2ec3f0730729f4829d01f7c19538d135f86712
Btrfs: fix warning of free_extent_map

Users report that an extent map's list is still linked when it's actually
going to be freed from cache.

The story is that

a) when we're going to drop an extent map and may split this large one into
smaller ems, and if this large one is flagged as EXTENT_FLAG_LOGGING which means
that it's on the list to be logged, then the smaller ems split from it will also
be flagged as EXTENT_FLAG_LOGGING, and this is _not_ expected.

b) we'll keep ems from unlinking the list and freeing when they are flagged with
EXTENT_FLAG_LOGGING, because the log code holds one reference.

The end result is the warning, but the truth is that we set the flag
EXTENT_FLAG_LOGGING only during fsync.

So clear flag EXTENT_FLAG_LOGGING for extent maps split from a large one.

Reported-by: Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
Reported-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/file.c