1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

15876 Commits

Author SHA1 Message Date
Zdenek Kabelac
9d9979963f debug: tracing fclose failure
Using log_debug (not returning error code) to trace possible
failure of fclose().
2018-11-05 17:25:11 +01:00
Zdenek Kabelac
aa8b2d6a0f cleanup: move cast to det_t into MKDEV macro 2018-11-05 17:25:11 +01:00
Zdenek Kabelac
d3ebb18f40 cov: avoid unsing unchecked label_scan_open
Drop extra call too label_scan_open() without checking return value,
and let code go through next call bellow.
2018-11-05 17:25:11 +01:00
Zdenek Kabelac
70e3d0a613 cov: remove unused assigns 2018-11-05 17:25:11 +01:00
Zdenek Kabelac
a91ac41b93 cov: hide intentionaly ptr arithmetic report
Only single region count is ever replaced with on-stack uint64_t.
2018-11-03 16:10:32 +01:00
Zdenek Kabelac
9238b972c5 cov: mark warning as expected one 2018-11-03 16:10:32 +01:00
Zdenek Kabelac
0d934e730e cov: trace failing pthread_kill 2018-11-03 16:10:32 +01:00
Zdenek Kabelac
813347cf84 cov: add missing check for dm_strncpy 2018-11-03 16:10:32 +01:00
Zdenek Kabelac
c7789daec0 cov: overflow before widen
Evaluate as 64bit arithmetic (instead of doing 32bit mults which can
in this case purely teoretically overflow).
2018-11-03 16:10:31 +01:00
Zdenek Kabelac
bc1976011a cov: explicit ignore if failures
Here we can't do anything better than just ignore syscall failures
(with silence as there is no loging mechanism)
2018-11-03 16:09:36 +01:00
Zdenek Kabelac
79879bd201 cov: split check for type assignment
Check that type is always defined, if not make it explicit internal
error (although logged as debug - so catched only with proper lvm.conf
setting).
This ensures later type being NULL can't be dereferenced with coredump.
2018-11-03 16:09:36 +01:00
Zdenek Kabelac
6235861e64 cov: remove uneeded code
Since clvmd was dropped this code become useless.
2018-11-03 16:09:36 +01:00
Zdenek Kabelac
1951e0db0f label: add stack trace for failing dev_set_last_byte
Temporarily add check for failure, but whole function
needs to be likely traced for error result.

FIXME
2018-11-03 16:09:36 +01:00
David Teigland
5d747f724e lvmlockd: use standard major minor functions 2018-11-02 15:58:47 -05:00
David Teigland
e7a56d5cd3 lvmlockd: fix handling of sanlock release error
When sanlock_release returns an error because of an i/o
timeout releasing the lease on disk, lvmlockd should just
consider the lock released.  sanlock will continue trying
to release the lease on disk after the original request
times out.
2018-11-02 12:11:09 -05:00
David Teigland
f6a54a50a0 lvmlockd: deactivate lvmlock LV in vgchange
When changing a VG to lock_type sanlock, the internal
lvmlock LV was left active at the end of vgchange.
It shouldn't be active until lockstart.
2018-11-01 13:25:21 -05:00
David Teigland
7a170873aa lvmlockd: fix size/resizing of internal lvmlock LV for sanlock
The lvmlock LV size was not adjusted correctly for 512 vs 4K
sector sizes which influence the lease size used by sanlock.

When lvmlock was automatically extended, the zeroing through
bcache wasn't working.
2018-11-01 13:25:21 -05:00
David Teigland
0b01e3f5d7 lvmlockd: use new sanlock sector/align interface
The choice about sector size and lease align size is
now made by the sanlock user, in this case lvmlockd.
This will allow lvmlockd to use other lease sizes in
the future.  This also prevents breakage if hosts
report different sector sizes, or the sector size
reported by a device changes.
2018-11-01 13:25:21 -05:00
Bryn M. Reeves
925aaf0b87 dmsetup: fix stats report command output
Since the stats handle is neither bound nor listed before the
attempt to call dm_stats_get_nr_regions(), it will always return
zero: this prevents reporting of any dmstats regions on any
device.

Remove the dm_stats_get_nr_regions() check and instead rely on
the correct return status from dm_stats_populate() which only
returns 0 in the case that there are regions to inspect (and
which logs a specific error for all other cases).

Reported-by: Bryan Gurney <bgurney@redhat.com>
2018-11-01 17:00:06 +00:00
Bryn M. Reeves
19f2105b87 libdm-stats: move no regions warning after dm_stats_list()
It doesn't make sense to test or warn about the region count until
the stats handle has been listed: at this point it may or may not
contain valid information (but is guaranteed to be correct after
the list).
2018-11-01 16:59:56 +00:00
Marian Csontos
420af27f08 post-release 2018-10-31 15:56:41 +01:00
Marian Csontos
913c28917e pre-release 2018-10-31 15:39:50 +01:00
Marian Csontos
1e40e734e6 build: Fix CLDFLAGS default 2018-10-30 10:15:44 +01:00
David Teigland
aecf542126 metadata: prevent writing beyond metadata area
lvm uses a bcache block size of 128K.  A bcache block
at the end of the metadata area will overlap the PEs
from which LVs are allocated.  How much depends on
alignments.  When lvm reads and writes one of these
bcache blocks to update VG metadata, it can also be
reading and writing PEs that belong to an LV.

If these overlapping PEs are being written to by the
LV user (e.g. filesystem) at the same time that lvm
is modifying VG metadata in the overlapping bcache
block, then the user's updates to the PEs can be lost.

This patch is a quick hack to prevent lvm from writing
past the end of the metadata area.
2018-10-29 16:53:17 -05:00
Heinz Mauelshagen
8df2dd66ce Revert "raid: fix left behind SubLVs"
This reverts commit 16ae968d24.

We need to come up with a better fix, because we fall short
wiping all known signatures when not using the wipe_lv API.
2018-10-25 14:35:56 +02:00
Heinz Mauelshagen
16ae968d24 raid: fix left behind SubLVs
lvm metadata writes, commits and activations are performed
for (newly) allocated RAID metadata SubLVs to wipe any preexisiting
data thus avoid false raid superblock positives on RaidLV activation.

This process can be interrupted by command or system crashs
thus leaving stale SubLVs in the lvm metadata as a problem.

Because we hold an exclusive lock in this metadata SubLV wiping
process, we can address this problem by avoiding aforementioned
commits/writes/activations altogether wiping the respective first
sector of the first physical extent allocated to any metadata SubLV
directly via the existing dev_set() API.

Succeeds all LVM RAID tests.

Related: rhbz1633167
2018-10-24 16:35:30 +02:00
Marian Csontos
fc35a9169e spec: lvmdbusd requires python3 setuptools 2018-10-22 12:51:51 +02:00
David Teigland
7498f83833 tests: add new test for lvm on md devices 2018-10-18 13:06:42 -05:00
Zdenek Kabelac
9e1ee07d69 tests: missed char in list
'=' also doesn't belong to property name.
2018-10-17 10:41:25 +02:00
Zdenek Kabelac
015231b11f tests: better support for /var/run 2018-10-16 23:49:35 +02:00
Zdenek Kabelac
32f1afbe36 tests: add raid target presence check 2018-10-16 23:49:35 +02:00
Zdenek Kabelac
69bebfd958 tests: fix conf generation with older shells
For shells without array support, fix selecting bug,
and require keyword to end with some 'space' char,
so  'scan' is not matched with  'scan_var'.
2018-10-16 23:49:35 +02:00
Zdenek Kabelac
f1ac72c848 tests: properly enforce v1
Since with smq policy we can still pick format v2 - enforce
format v1 explicitely.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
4db228b907 tests: timing without /usr/bin/time
Use just 'date' so the 'time' package doesn't need to be installed
just for this purpose.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
c15ac326cc tests: fix tested targeted
Fix cut&paste bug.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
05b5774827 cov: shutdown warning
Since previous patch reverted coverity patch as this case is intentional,
provide override this coverity warning.
2018-10-16 21:55:19 +02:00
Zdenek Kabelac
6179cab877 revert "cov: dm stats missed terminating null"
This reverts commit 20971f7034
as the parsing of 'dmstatus' started to fail on present \0 char.
2018-10-16 21:34:23 +02:00
David Teigland
2217d6396a fix: cov: missed return value test
use the existing error paths
2018-10-15 11:53:28 -05:00
Zdenek Kabelac
06a4a356db cov: avoid selfrecursive inclusion of toolcontext.h 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
fdd76da33d cov: drop uneeded header files 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
c4f39decc8 cov: pvscan ensure sigle_devs list is always initialized 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
43e4bfe428 cov: ignore error of vsnprintf 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
84f00f5058 cov: add missing error path check for label_scan_open 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
b57e73a0f1 cov: make sure label scans valid lvinfo 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
70950bbd97 cov: log failing unlink 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
f1ac130dc1 cov: check closedir result
Log problems around failing closedir().
2018-10-15 17:49:44 +02:00
Zdenek Kabelac
668c9d0762 cov: check dm_strncpy result 2018-10-15 17:49:44 +02:00
Zdenek Kabelac
b1ff52ca14 cov: check dev_close_immediate
Function can report log_error() on fail path.
2018-10-15 17:49:44 +02:00
Zdenek Kabelac
2513661467 cov: ensure vars are set
Make sure, tmp_begin and tmp_end are always set, even for blind
coverity.
2018-10-15 17:49:44 +02:00
Zdenek Kabelac
cbbdace006 cov: dm node message fix missing initilization
In 2 teoretical error path the 'r' value has not been set to
proper value before possible use in error path.
2018-10-15 17:49:44 +02:00