02 Aug, 2011
3 commits
-
Use vzalloc() instead of vmalloc()+memset().
Signed-off-by: Joe Perches
Signed-off-by: Alasdair G Kergon -
Using __test_and_{set,clear}_bit_le() with ignoring its return value
can be replaced with __{set,clear}_bit_le().This also removes unnecessary casts.
Signed-off-by: Akinobu Mita
Signed-off-by: Alasdair G Kergon -
Suppress sparse warnings about cpu_to_le32() by using __le32 types for
on-disk data etc.Signed-off-by: Alasdair G Kergon
29 May, 2011
1 commit
-
Replace the arbitrary calculation of an initial io struct mempool size
with a constant.The code calculated the number of reserved structures based on the request
size and used a "magic" multiplication constant of 4. This patch changes
it to reserve a fixed number - itself still chosen quite arbitrarily.
Further testing might show if there is a better number to choose.Note that if there is no memory pressure, we can still allocate an
arbitrary number of "struct io" structures. One structure is enough to
process the whole request.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
26 Mar, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
dm stripe: implement merge method
dm mpath: allow table load with no priority groups
dm mpath: fail message ioctl if specified path is not valid
dm ioctl: add flag to wipe buffers for secure data
dm ioctl: prepare for crypt key wiping
dm crypt: wipe keys string immediately after key is set
dm: add flakey target
dm: fix opening log and cow devices for read only tables
24 Mar, 2011
2 commits
-
If a table is read-only, also open any log and cow devices it uses read-only.
Previously, even read-only devices were opened read-write internally.
After patch 75f1dc0d076d1c1168f2115f1941ea627d38bd5a
block: check bdev_read_only() from blkdev_get()
was applied, loading such tables began to fail. The patch
was reverted by e51900f7d38cbcfb481d84567fd92540e7e1d23a
block: revert block_dev read-only check
but this patch fixes this part of the code to work with the original patch.Signed-off-by: Milan Broz
Signed-off-by: Alasdair G Kergon -
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little-endian bit operations.Signed-off-by: Akinobu Mita
Cc: Alasdair Kergon
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Jan, 2011
1 commit
-
It's nicer to return the PTR_ERR() value instead of just returning
-ENOMEM. In the current code the PTR_ERR() value is always equal to
-ENOMEM so this doesn't actually affect anything, but still...In addition, dm_dirty_log_create() doesn't check for a specific -ENOMEM
return. So this change is safe relative to potential for a non -ENOMEM
return in the future.Signed-off-by: Dan Carpenter
Acked-by: Jonathan Brassow
Signed-off-by: Mike Snitzer
Signed-off-by: Alasdair G Kergon
10 Sep, 2010
1 commit
-
This patch converts bio-based dm to support REQ_FLUSH/FUA instead of
now deprecated REQ_HARDBARRIER.* -EOPNOTSUPP handling logic dropped.
* Preflush is handled as before but postflush is dropped and replaced
with passing down REQ_FUA to member request_queues. This replaces
one array wide cache flush w/ member specific FUA writes.* __split_and_process_bio() now calls __clone_and_map_flush() directly
for flushes and guarantees all FLUSH bio's going to targets are zero
` length.* It's now guaranteed that all FLUSH bio's which are passed onto dm
targets are zero length. bio_empty_barrier() tests are replaced
with REQ_FLUSH tests.* Empty WRITE_BARRIERs are replaced with WRITE_FLUSHes.
* Dropped unlikely() around REQ_FLUSH tests. Flushes are not unlikely
enough to be marked with unlikely().* Block layer now filters out REQ_FLUSH/FUA bio's if the request_queue
doesn't support cache flushing. Advertise REQ_FLUSH | REQ_FUA
capability.* Request based dm isn't converted yet. dm_init_request_based_queue()
resets flush support to 0 for now. To avoid disturbing request
based dm code, dm->flush_error is added for bio based dm while
requested based dm continues to use dm->barrier_error.Lightly tested linear, stripe, raid1, snap and crypt targets. Please
proceed with caution as I'm not familiar with the code base.Signed-off-by: Tejun Heo
Cc: dm-devel@redhat.com
Cc: Christoph Hellwig
Signed-off-by: Jens Axboe
06 Mar, 2010
1 commit
-
Remove unused parameters(start and len) of dm_get_device()
and fix the callers.Signed-off-by: Nikanth Karthikesan
Signed-off-by: Alasdair G Kergon
11 Dec, 2009
6 commits
-
Report flush errors as 'F' instead of 'D' for log and mirror devices.
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Call the flush callback from the log.
If flush failed, we have no alternative but to mark the whole log as dirty.
Also we set the variable flush_failed to prevent any bits ever being marked as
clean again.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Introduce a callback pointer from the log to dm-raid1 layer.
Before some region is set as "in-sync", we need to flush hardware cache on
all the disks. But the log module doesn't have access to the mirror_set
structure. So it will use this callback.So far the callback is unused, it will be used in further patches.
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Introduce "flush failed" variable. When a flush before clearing a bit
in the log fails, we don't know anything about which which regions are
in-sync and which not.So we need to set all regions as not-in-sync and set the variable
"flush_failed" to prevent setting the in-sync bit in the future.A target reload is the only way to get out of this situation.
The variable will be set in following patches.
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Introduce flush_header and use it to flush the log device.
Note that we don't have to flush if all the regions transition
from "dirty" to "clean" state.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Split the variable "touched" into two, "touched_dirtied" and
"touched_cleaned", set when some region was dirtied or cleaned.This will be used to optimize flushes.
After a transition from "dirty" to "clean" state we don't have flush hardware
cache on the log device. After a transition from "clean" to "dirty" the cache
must be flushed.Before a transition from "clean" to "dirty" state we don't have to flush all
the raid legs. Before a transition from "dirty" to "clean" we must flush all
the legs to make sure that they are really in sync.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
22 Jun, 2009
2 commits
-
create_log_context() must use the logical_block_size from the log disk,
where the I/O happens, not the target's logical_block_size.Signed-off-by: Mike Snitzer
Signed-off-by: Alasdair G Kergon -
Use i_size_read() instead of reading i_size.
If someone changes the size of the device simultaneously, i_size_read
is guaranteed to return a valid value (either the old one or the new one).i_size can return some intermediate invalid value (on 32-bit computers
with 64-bit i_size, the reads to both halves of i_size can be interleaved
with updates to i_size, resulting in garbage being returned).Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
23 May, 2009
1 commit
-
Until now we have had a 1:1 mapping between storage device physical
block size and the logical block sized used when addressing the device.
With SATA 4KB drives coming out that will no longer be the case. The
sector size will be 4KB but the logical block size will remain
512-bytes. Hence we need to distinguish between the physical block size
and the logical ditto.This patch renames hardsect_size to logical_block_size.
Signed-off-by: Martin K. Petersen
Signed-off-by: Jens Axboe
03 Apr, 2009
2 commits
-
Remove the 'dm_dirty_log_internal' structure. The resulting cleanup
eliminates extra memory allocations. Therefore exposing the internal
list_head to the external 'dm_dirty_log_type' structure is a worthwhile
compromise.Signed-off-by: Mike Snitzer
Signed-off-by: Alasdair G Kergon -
Avoid private module usage accounting by removing 'use' from
dm_dirty_log_internal. The standard module reference counting is
sufficient.Signed-off-by: Mike Snitzer
Signed-off-by: Alasdair G Kergon
06 Jan, 2009
4 commits
-
Check that the log bitmap will fit within the log device.
Signed-off-by: Milan Broz
Signed-off-by: Alasdair G Kergon -
Move log size validation from mirror target to log constructor.
Removed PAGE_SIZE restriction we no longer think necessary.
Signed-off-by: Milan Broz
Signed-off-by: Alasdair G Kergon -
rw_header function updates three members of io_req data every time
when I/O is processed. bi_rw and notify.fn are never modified once
they get initialized, and so they can be set in advance.header_to_disk() can also be pulled out of write_header() since only one
caller needs it and write_header() can be replaced by rw_header()
directly.Signed-off-by: Takahiro Yasui
Signed-off-by: Alasdair G Kergon -
In create_log_context function, dm_io_client_destroy function needs
to be called, when memory allocation of disk_header, sync_bits and
recovering_bits failed, but dm_io_client_destroy is not called.Cc: stable@kernel.org
Signed-off-by: Takahiro Yasui
Acked-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon
22 Oct, 2008
1 commit
-
Change #include "dm.h" to #include in all targets.
Targets should not need direct access to internal DM structures.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
21 Jul, 2008
1 commit
-
dm_dirty_log_{init,exit}() can now become static.
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Alasdair G Kergon
25 Apr, 2008
7 commits
-
Publish the dm-io, dm-log and dm-kcopyd headers in include/linux.
Signed-off-by: Alasdair G Kergon
-
Remove internal module reference fields from the interface.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Reorder a couple of functions in the file so the next patch is readable.
Signed-off-by: Alasdair G Kergon
-
Clean up the dm-log interface to prepare for publishing it in include/linux.
Signed-off-by: Heinz Mauelshagen
Signed-off-by: Alasdair G Kergon -
Clean up the dm-io interface to prepare for publishing it in include/linux.
Signed-off-by: Heinz Mauelshagen
Signed-off-by: Alasdair G Kergon -
Move the dirty region log code into a separate module so
other targets can share the code.Signed-off-by: Heinz Mauelshagen
Signed-off-by: Alasdair G Kergon -
Change dm-log.c messages from "mirror log" to "dirty region log" as
a new dm target wants to share this code.Signed-off-by: Heinz Mauelshagen
Signed-off-by: Alasdair G Kergon
08 Feb, 2008
1 commit
-
If the log type is not recognised, attempt to load the module
'dm-log-.ko'.Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon
20 Oct, 2007
1 commit
-
There are now two phases to a suspend in device-mapper -
presuspend and postsuspend. This patch removes the
single 'suspend' in the logging API and replaces it with
'presuspend' and 'postsuspend' functions to align it
better with core device-mapper.A subsequent patch will make use of 'presuspend'.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon
10 May, 2007
4 commits
-
This patch removes the possibility of having uninitialized log state if the
log device has failed.When a mirror resumes operation, it calls 'resume' on the logging module. If
disk based logging is being used, the log device is read to fill in the log
state. If the log device has failed, we cannot simply return, because this
would leave the in-memory log state uninitialized. Instead, we assume all
regions are out-of-sync and reset the log state. Failure to do this could
result in the logging code reporting a region as in-sync, even though it
isn't; which could result in a corrupted mirror.Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch ports dm-log.c to the new dm-io interface in order to make it
scalable to have a large number of persistent dirty logs active in parallel.Signed-off-by: Heinz Mauelshagen
Cc: Milan Broz
Signed-off-by: Alasdair G Kergon
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch reports the status of the log device so that userspace can detect
the error and take appropriate action.Signed-off-by: Jonathan E Brassow
Signed-off-by: Alasdair G Kergon
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch gives the disk logging code the ability to store the fact that an
error occured on the log device. In addition, an event is raised when an
error is encountered during I/O to the log device.Signed-off-by: Jonathan E Brassow
Signed-off-by: Alasdair G Kergon
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds