Commit 46691b42 authored by Christoph Hellwig's avatar Christoph Hellwig

[XFS] plug a pagebuf leak

SGI Modid: xfs-linux:xfs-kern:166109a
parent 8f062df2
...@@ -384,8 +384,8 @@ _pagebuf_freepages( ...@@ -384,8 +384,8 @@ _pagebuf_freepages(
* pagebuf_free releases the specified buffer. The modification * pagebuf_free releases the specified buffer. The modification
* state of any associated pages is left unchanged. * state of any associated pages is left unchanged.
*/ */
void STATIC void
pagebuf_free( __pagebuf_free(
page_buf_t *pb) page_buf_t *pb)
{ {
pb_hash_t *hash = pb_hash(pb); pb_hash_t *hash = pb_hash(pb);
...@@ -431,6 +431,17 @@ pagebuf_free( ...@@ -431,6 +431,17 @@ pagebuf_free(
pagebuf_deallocate(pb); pagebuf_deallocate(pb);
} }
void
pagebuf_free(
page_buf_t *pb)
{
if (unlikely(!atomic_dec_and_test(&pb->pb_hold))) {
printk(KERN_ERR "XFS: freeing inuse buffer!\n");
dump_stack();
} else
__pagebuf_free(pb);
}
/* /*
* _pagebuf_lookup_pages * _pagebuf_lookup_pages
* *
...@@ -1028,7 +1039,7 @@ pagebuf_rele( ...@@ -1028,7 +1039,7 @@ pagebuf_rele(
} }
if (do_free) { if (do_free) {
pagebuf_free(pb); __pagebuf_free(pb);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment