The patch titled
device-mapper: Fix dm_swap_table error cases
has been added to the -mm tree. Its filename is
device-mapper-fix-dm_swap_table-error-cases.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
device-mapper-multipath-barriers-not-supported.patch
device-mapper-multipath-flush-workqueue-when-destroying.patch
device-mapper-multipath-avoid-possible-suspension-deadlock.patch
device-mapper-multipath-fix-pg-initialisation-races.patch
device-mapper-fix-dm_swap_table-error-cases.patch
device-mapper-snapshots-handle-origin-extension.patch
From: Alasdair G Kergon <[EMAIL PROTECTED]>
Fix dm_swap_table() __bind error cases: a missing unlock, and EINVAL
preferable to EPERM.
Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
drivers/md/dm.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff -puN drivers/md/dm.c~device-mapper-fix-dm_swap_table-error-cases
drivers/md/dm.c
--- 25/drivers/md/dm.c~device-mapper-fix-dm_swap_table-error-cases Fri Jul
8 16:45:34 2005
+++ 25-akpm/drivers/md/dm.c Fri Jul 8 16:45:34 2005
@@ -966,23 +966,20 @@ static void __flush_deferred_io(struct m
*/
int dm_swap_table(struct mapped_device *md, struct dm_table *table)
{
- int r;
+ int r = -EINVAL;
down_write(&md->lock);
/* device must be suspended */
- if (!test_bit(DMF_SUSPENDED, &md->flags)) {
- up_write(&md->lock);
- return -EPERM;
- }
+ if (!test_bit(DMF_SUSPENDED, &md->flags))
+ goto out;
__unbind(md);
r = __bind(md, table);
- if (r)
- return r;
+out:
up_write(&md->lock);
- return 0;
+ return r;
}
/*
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html