When dir is ignored, and 0 is passed instead, each flush request will
appear as READ request, which is not supported by some block device
drivers.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
One of the steps of discarding data in cache is invalidating OCF metadata.
If a cache line which is supposed to be discarded is dirty, invalidating
it will require flushing metadata. Unfortunately, OCF allocates flushing
requests with the exactly the same flags as the original IO (in this case
discard flag is set) so the page on the disk is discarded instead of being
flushed. In case of power failure occurring before the metadata is flushed
to the disk, the data may be corrupted even if recovery will succeed.
Disabling propagation of original I/O flags for discard requests solves
this problem.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Adjust manner of calculating some of the traits to the newer kernel version.
New way of calculating them have been introduced in kernel with commit
97f433c3601a24d3513d06f575a389a2ca4e11e4.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
The disk's partitions table was changed to xarray.
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Moved cas_blk_get_part_count function to configure section after the
the disk's partitions table was changed to xarray.
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
The module_mutex is internal to the module loader since kernel
commit 922f2a7c.
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
When cache is in standby mode config section of cache stats should contain only
relevant information.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Error message updated for the case of not meeting the space requirements
for the cache device.
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
Fix for issue #1020 - make casadm produce a meaningful output when
listing a detached cache
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
To prevent flushing all dirty cache lines before the power shutdown, create
bigger file.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Instead of creating a test file twice (once with `direct` flag and once with
`sync` flag), prepare it only once (with `sync` flag). Additionally allow
classifier to settle after the IO.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>