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 314571 Details for
Bug 459337
dm-snap.c: Data read from snapshot may be corrupt if origin is being written to simultaneously
[?]
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 2/2 --- fix this bug
linux-2.6.18-dm-snapshot-fix-race-during-exception-creation.patch (text/plain), 1.92 KB, created by
Mikuláš Patočka
on 2008-08-19 21:01:30 UTC
(
hide
)
Description:
PATCH 2/2 --- fix this bug
Filename:
MIME Type:
Creator:
Mikuláš Patočka
Created:
2008-08-19 21:01:30 UTC
Size:
1.92 KB
patch
obsolete
>upstream commit: a8d41b59f3f5a7ac19452ef442a7fc1b5fa17366 (2.6.27-rc1) > >dm snapshot: fix race during exception creation > >Fix a race condition that returns incorrect data when a write causes an >exception to be allocated whilst a read is still in flight. > >The race condition happens as follows: >* A read to non-reallocated sector in the snapshot is submitted so that the > read is routed to the original device. >* A write to the original device is submitted. The write causes an exception > that reallocates the block. The write proceeds. >* The original read is dequeued and reads the wrong data. > >This race can be triggered with CFQ scheduler and one thread writing and >multiple threads reading simultaneously. > >diff -p -u -r linux-2.6.18.x86_64.p5/drivers/md/dm-snap.c linux-2.6.18.x86_64/drivers/md/dm-snap.c >--- linux-2.6.18.x86_64.p5/drivers/md/dm-snap.c 2008-08-19 03:45:17.000000000 +0200 >+++ linux-2.6.18.x86_64/drivers/md/dm-snap.c 2008-08-19 04:03:31.000000000 +0200 >@@ -133,6 +133,27 @@ static void stop_tracking_chunk(struct d > mempool_free(c, s->tracked_chunk_pool); > } > >+static int __chunk_is_tracked(struct dm_snapshot *s, chunk_t chunk) >+{ >+ struct dm_snap_tracked_chunk *c; >+ struct hlist_node *hn; >+ int found = 0; >+ >+ spin_lock_irq(&s->tracked_chunk_lock); >+ >+ hlist_for_each_entry(c, hn, >+ &s->tracked_chunk_hash[DM_TRACKED_CHUNK_HASH(chunk)], node) { >+ if (c->chunk == chunk) { >+ found = 1; >+ break; >+ } >+ } >+ >+ spin_unlock_irq(&s->tracked_chunk_lock); >+ >+ return found; >+} >+ > /* > * One of these per registered origin, held in the snapshot_origins hash > */ >@@ -843,6 +864,13 @@ static void pending_complete(struct pend > } > > /* >+ * Check for conflicting reads. This is extremely improbable, >+ * so yield() is sufficient and there is no need for a wait queue. >+ */ >+ while (__chunk_is_tracked(s, pe->e.old_chunk)) >+ yield(); >+ >+ /* > * Add a proper exception, and remove the > * in-flight exception from the list. > */
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 459337
:
314570
| 314571 |
314572
|
314573