[PATCH] reiserfs locking fix
reiserfs is using b_inode_buffers and fsync_buffers_list() for attaching dependent buffers to its journal. For writeout prior to commit. This worked OK when a global lock was used everywhere, but the locking is currently incorrect - try_to_free_buffers() is taking a different lock when detaching buffers from their "foreign" inode. So list_head corruption could occur on SMP. The patch implements a reiserfs_releasepage() which holds the journal-wide buffer lock while it runs try_to_free_buffers(), so all those list_heads are protected. The lock is held across the try_to_free_buffers() call as well, so nobody will attach one of this page's buffers to a list while try_to_free_buffers() is running.
Showing
Please register or sign in to comment