Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 266427 Details for
Bug 357657
Fix possible cause of a page_mapped BUG in mm/mremap.c
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
prevent-concurrent-unmap_mapping_range fix (backported to 2.6.32.x)
2.6.32.33_mm-prevent-concurrent-unmap_mapping_range-on-same-inode.patch (text/plain), 4.75 KB, created by
RumpletonBongworth
on 2011-03-19 04:26:06 UTC
(
hide
)
Description:
prevent-concurrent-unmap_mapping_range fix (backported to 2.6.32.x)
Filename:
MIME Type:
Creator:
RumpletonBongworth
Created:
2011-03-19 04:26:06 UTC
Size:
4.75 KB
patch
obsolete
>diff -urp a/fs/inode.c b/fs/inode.c >--- a/fs/inode.c 2009-12-03 03:51:21.000000000 +0000 >+++ b/fs/inode.c 2011-03-19 04:09:18.249124833 +0000 >@@ -256,6 +256,19 @@ void destroy_inode(struct inode *inode) > kmem_cache_free(inode_cachep, (inode)); > } > >+void address_space_init_once(struct address_space *mapping) >+{ >+ memset(mapping, 0, sizeof(*mapping)); >+ INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); >+ spin_lock_init(&mapping->tree_lock); >+ spin_lock_init(&mapping->i_mmap_lock); >+ INIT_LIST_HEAD(&mapping->private_list); >+ spin_lock_init(&mapping->private_lock); >+ INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); >+ INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); >+ mutex_init(&mapping->unmap_mutex); >+} >+ > /* > * These are initializations that only need to be done > * once, because the fields are idempotent across use >@@ -267,13 +280,7 @@ void inode_init_once(struct inode *inode > INIT_HLIST_NODE(&inode->i_hash); > INIT_LIST_HEAD(&inode->i_dentry); > INIT_LIST_HEAD(&inode->i_devices); >- INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC); >- spin_lock_init(&inode->i_data.tree_lock); >- spin_lock_init(&inode->i_data.i_mmap_lock); >- INIT_LIST_HEAD(&inode->i_data.private_list); >- spin_lock_init(&inode->i_data.private_lock); >- INIT_RAW_PRIO_TREE_ROOT(&inode->i_data.i_mmap); >- INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear); >+ address_space_init_once(&inode->i_data); > i_size_ordered_init(inode); > #ifdef CONFIG_INOTIFY > INIT_LIST_HEAD(&inode->inotify_watches); >diff -urp a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c >--- a/fs/nilfs2/btnode.c 2009-12-03 03:51:21.000000000 +0000 >+++ b/fs/nilfs2/btnode.c 2011-03-19 04:10:09.013124741 +0000 >@@ -34,19 +34,6 @@ > #include "btnode.h" > > >-void nilfs_btnode_cache_init_once(struct address_space *btnc) >-{ >- memset(btnc, 0, sizeof(*btnc)); >- INIT_RADIX_TREE(&btnc->page_tree, GFP_ATOMIC); >- spin_lock_init(&btnc->tree_lock); >- INIT_LIST_HEAD(&btnc->private_list); >- spin_lock_init(&btnc->private_lock); >- >- spin_lock_init(&btnc->i_mmap_lock); >- INIT_RAW_PRIO_TREE_ROOT(&btnc->i_mmap); >- INIT_LIST_HEAD(&btnc->i_mmap_nonlinear); >-} >- > static const struct address_space_operations def_btnode_aops = { > .sync_page = block_sync_page, > }; >diff -urp a/fs/nilfs2/btnode.h b/fs/nilfs2/btnode.h >--- a/fs/nilfs2/btnode.h 2009-12-03 03:51:21.000000000 +0000 >+++ b/fs/nilfs2/btnode.h 2011-03-19 04:10:22.820622908 +0000 >@@ -37,7 +37,6 @@ struct nilfs_btnode_chkey_ctxt { > struct buffer_head *newbh; > }; > >-void nilfs_btnode_cache_init_once(struct address_space *); > void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); > void nilfs_btnode_cache_clear(struct address_space *); > int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, >diff -urp a/fs/nilfs2/super.c b/fs/nilfs2/super.c >--- a/fs/nilfs2/super.c 2011-03-19 03:58:57.000000000 +0000 >+++ b/fs/nilfs2/super.c 2011-03-19 04:12:21.501142492 +0000 >@@ -166,7 +166,7 @@ static void init_once(void *obj) > #ifdef CONFIG_NILFS_XATTR > init_rwsem(&ii->xattr_sem); > #endif >- nilfs_btnode_cache_init_once(&ii->i_btnode_cache); >+ address_space_init_once(&ii->i_btnode_cache); > ii->i_bmap = (struct nilfs_bmap *)&ii->i_bmap_union; > inode_init_once(&ii->vfs_inode); > } >diff -urp a/include/linux/fs.h b/include/linux/fs.h >--- a/include/linux/fs.h 2011-03-19 03:59:20.000000000 +0000 >+++ b/include/linux/fs.h 2011-03-19 04:14:14.061141568 +0000 >@@ -640,6 +640,7 @@ struct address_space { > spinlock_t private_lock; /* for use by the address_space */ > struct list_head private_list; /* ditto */ > struct address_space *assoc_mapping; /* ditto */ >+ struct mutex unmap_mutex; /* to protect unmapping */ > } __attribute__((aligned(sizeof(long)))); > /* > * On most architectures that alignment is already the case; but >@@ -2163,6 +2164,7 @@ extern loff_t vfs_llseek(struct file *fi > > extern int inode_init_always(struct super_block *, struct inode *); > extern void inode_init_once(struct inode *); >+extern void address_space_init_once(struct address_space *mapping); > extern void inode_add_to_lists(struct super_block *, struct inode *); > extern void iput(struct inode *); > extern struct inode * igrab(struct inode *); >diff -urp a/mm/memory.c b/mm/memory.c >--- a/mm/memory.c 2011-03-19 03:59:20.000000000 +0000 >+++ b/mm/memory.c 2011-03-19 04:15:49.332622739 +0000 >@@ -2668,6 +2668,7 @@ void unmap_mapping_range(struct address_ > details.last_index = ULONG_MAX; > details.i_mmap_lock = &mapping->i_mmap_lock; > >+ mutex_lock(&mapping->unmap_mutex); > spin_lock(&mapping->i_mmap_lock); > > /* Protect against endless unmapping loops */ >@@ -2684,6 +2685,7 @@ void unmap_mapping_range(struct address_ > if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) > unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details); > spin_unlock(&mapping->i_mmap_lock); >+ mutex_unlock(&mapping->unmap_mutex); > } > EXPORT_SYMBOL(unmap_mapping_range); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 357657
:
266427
|
266429
|
266431
|
266435