Re: [PATCH] Fix deadlocks in filemap_write_page, fixes ReiserFS for >= pre7-4, etc.

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Wed May 17 2000 - 18:42:51 EST


>>>>> "matt" == Matt Yourst <yourst@mit.edu> writes:

matt> Patch to 2.3.99-pre9-2:

matt> --- mm/filemap.c.orig Wed May 17 18:48:16 2000
matt> +++ mm/filemap.c Wed May 17 18:48:39 2000
matt> @@ -1543,7 +1543,11 @@
matt> * vma/file is guaranteed to exist in the unmap/sync cases because
matt> * mmap_sem is held.
matt> */
matt> - return page->mapping->a_ops->writepage(file, page);
matt> + int result;
matt> + lock_page(page);
matt> + result = page->mapping->a_ops->writepage(file, page);
matt> + UnlockPage(page);
matt> + return result;
matt> }
 
 
matt> @@ -1601,9 +1605,7 @@
matt> printk("weirdness: pgoff=%lu index=%lu address=%lu vm_start=%lu
matt> vm_pgoff=%lu\n",
matt> pgoff, page->index, address, vma->vm_start, vma->vm_pgoff);
matt> }
matt> - lock_page(page);
matt> error = filemap_write_page(vma->vm_file, page, 1);
matt> - UnlockPage(page);
matt> page_cache_free(page);
matt> return error;
matt> }

matt> I hope this works without any other side effects.

This change had one intention, but I can remember just now, I think
that the swapout code needs that now, but I can't remind the reason in
the top of my head. The change was to solve one race in other path,
but I can't remember, sorry.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:13 EST