1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-05 16:16:45 +03:00

Report error when empty device name passed to readahead functions.

This commit is contained in:
Alasdair Kergon 2007-12-13 02:25:45 +00:00
parent ce9636b26f
commit 3a2234162d
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.24 -
===================================
Report error when empty device name passed to readahead functions.
Fix minimum readahead debug message.
Version 1.02.23 - 5th December 2007

View File

@ -382,6 +382,11 @@ int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead)
int fd;
long read_ahead_long;
if (!*dev_name) {
log_error("Empty device name passed to BLKRAGET");
return 0;
}
if ((fd = _open_dev_node(dev_name)) < 0)
return_0;
@ -406,6 +411,11 @@ static int _set_read_ahead(const char *dev_name, uint32_t read_ahead)
int fd;
long read_ahead_long = (long) read_ahead;
if (!*dev_name) {
log_error("Empty device name passed to BLKRAGET");
return 0;
}
if ((fd = _open_dev_node(dev_name)) < 0)
return_0;