Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 146716 Details for
Bug 190611
Race condition between i_mapping and iput() causes system panic
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to eliminate the i_mapping race in bd_acquire().
01_imapping_race.patch (text/plain), 1.53 KB, created by
Bob Miller
on 2007-01-26 21:30:52 UTC
(
hide
)
Description:
Patch to eliminate the i_mapping race in bd_acquire().
Filename:
MIME Type:
Creator:
Bob Miller
Created:
2007-01-26 21:30:52 UTC
Size:
1.53 KB
patch
obsolete
>--- linux-2.6.9-42.EL.orig/fs/block_dev.c 2006-11-17 09:56:50.000000000 -0800 >+++ linux-2.6.9-42.EL/fs/block_dev.c 2006-11-17 10:03:59.000000000 -0800 >@@ -413,21 +413,31 @@ > static struct block_device *bd_acquire(struct inode *inode) > { > struct block_device *bdev; >+ > spin_lock(&bdev_lock); > bdev = inode->i_bdev; >- if (bdev && igrab(bdev->bd_inode)) { >+ if (bdev) { >+ atomic_inc(&bdev->bd_inode->i_count); > spin_unlock(&bdev_lock); > return bdev; > } > spin_unlock(&bdev_lock); >+ > bdev = bdget(inode->i_rdev); > if (bdev) { > spin_lock(&bdev_lock); >- if (inode->i_bdev) >- __bd_forget(inode); >- inode->i_bdev = bdev; >- inode->i_mapping = bdev->bd_inode->i_mapping; >- list_add(&inode->i_devices, &bdev->bd_inodes); >+ if (!inode->i_bdev) { >+ /* >+ * We take an additional bd_inode->i_count for inode, >+ * and it's released in clear_inode() of inode. >+ * So, we can access it via ->i_mapping always >+ * without igrab(). >+ */ >+ atomic_inc(&bdev->bd_inode->i_count); >+ inode->i_bdev = bdev; >+ inode->i_mapping = bdev->bd_inode->i_mapping; >+ list_add(&inode->i_devices, &bdev->bd_inodes); >+ } > spin_unlock(&bdev_lock); > } > return bdev; >@@ -437,10 +447,18 @@ > > void bd_forget(struct inode *inode) > { >+ struct block_device *bdev = NULL; >+ > spin_lock(&bdev_lock); >- if (inode->i_bdev) >+ if (inode->i_bdev) { >+ if (inode->i_sb != blockdev_superblock) >+ bdev = inode->i_bdev; > __bd_forget(inode); >+ } > spin_unlock(&bdev_lock); >+ >+ if (bdev) >+ iput(bdev->bd_inode); > } > > int bd_claim(struct block_device *bdev, void *holder)
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 190611
: 146716