summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ec2ea18)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
*last_entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
*last_entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
- flist_add_tail(&(*last_entry)->list, &first->next);
-
+ if (*last_entry)
+ flist_add_tail(&(*last_entry)->list, &first->next);
stream->next_in = next_in;
stream->avail_in = next_sz;
do {
stream->next_in = next_in;
stream->avail_in = next_sz;
do {
- if (! stream->avail_out) {
-
+ if (!stream->avail_out) {
__fio_net_prep_tail(stream, *out_pdu, last_entry, first);
__fio_net_prep_tail(stream, *out_pdu, last_entry, first);
+ if (*last_entry == NULL)
+ return 1;
*out_pdu = malloc(FIO_SERVER_MAX_FRAGMENT_PDU);
*out_pdu = malloc(FIO_SERVER_MAX_FRAGMENT_PDU);
}
__fio_net_prep_tail(stream, out_pdu, &entry, first);
}
__fio_net_prep_tail(stream, out_pdu, &entry, first);
}
static int __fio_append_iolog_gz(struct sk_entry *first, struct io_log *log,
}
static int __fio_append_iolog_gz(struct sk_entry *first, struct io_log *log,
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
+ if (!entry) {
+ free(out_pdu);
+ return 1;
+ }
flist_add_tail(&entry->list, &first->next);
} while (stream->avail_in);
flist_add_tail(&entry->list, &first->next);
} while (stream->avail_in);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len,
NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE);
+ if (!entry) {
+ free(out_pdu);
+ break;
+ }
flist_add_tail(&entry->list, &first->next);
} while (ret != Z_STREAM_END);
flist_add_tail(&entry->list, &first->next);
} while (ret != Z_STREAM_END);
{
struct sk_entry *entry;
struct flist_head *node;
{
struct sk_entry *entry;
struct flist_head *node;
pthread_mutex_lock(&log->chunk_lock);
flist_for_each(node, &log->chunk_list) {
pthread_mutex_lock(&log->chunk_lock);
flist_for_each(node, &log->chunk_list) {
c = flist_entry(node, struct iolog_compress, list);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, c->buf, c->len,
NULL, SK_F_VEC | SK_F_INLINE);
c = flist_entry(node, struct iolog_compress, list);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, c->buf, c->len,
NULL, SK_F_VEC | SK_F_INLINE);
+ if (!entry) {
+ ret = 1;
+ break;
+ }
flist_add_tail(&entry->list, &first->next);
}
pthread_mutex_unlock(&log->chunk_lock);
flist_add_tail(&entry->list, &first->next);
}
pthread_mutex_unlock(&log->chunk_lock);
}
static int fio_append_text_log(struct sk_entry *first, struct io_log *log)
{
struct sk_entry *entry;
}
static int fio_append_text_log(struct sk_entry *first, struct io_log *log)
{
struct sk_entry *entry;
while (!flist_empty(&log->io_logs)) {
struct io_logs *cur_log;
while (!flist_empty(&log->io_logs)) {
struct io_logs *cur_log;
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, cur_log->log, size,
NULL, SK_F_VEC | SK_F_INLINE);
entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, cur_log->log, size,
NULL, SK_F_VEC | SK_F_INLINE);
+ if (!entry) {
+ ret = 1;
+ break;
+ }
flist_add_tail(&entry->list, &first->next);
}
flist_add_tail(&entry->list, &first->next);
}
}
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
}
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
* Assemble header entry first
*/
first = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, &pdu, sizeof(pdu), NULL, SK_F_VEC | SK_F_INLINE | SK_F_COPY);
* Assemble header entry first
*/
first = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, &pdu, sizeof(pdu), NULL, SK_F_VEC | SK_F_INLINE | SK_F_COPY);
+ if (!first)
+ return 1;
/*
* Now append actual log entries. If log compression was enabled on
/*
* Now append actual log entries. If log compression was enabled on