summaryrefslogtreecommitdiff
path: root/ioexact.h
blob: c69552bf82f2aa33b2c831f94af2f7bafe444a4b (plain)
1
2
3
4
5
6
7
8
9
#ifndef IOEXACT_H
#define IOEXACT_H

#include <stdbool.h>

extern ssize_t read_exact(int fd, void *buf, size_t len, bool mayexit);
extern ssize_t write_exact(int fd, void *buf, size_t len, bool mayexit);

#endif /* IOEXACT_H */
ion>space:mode:
authorChris Mason <clm@fb.com>2016-10-27 10:42:20 -0700
committerChris Mason <clm@fb.com>2016-10-27 10:42:20 -0700
commit570dd45042a7c8a7aba1ee029c5dd0f5ccf41b9b (patch)
tree8eef62c0d0b1481a4b70df1bc6b1c2e6fdbe5c2a /Documentation
parent112a3edf4bc687e02b9aa13c33391203fe6b7714 (diff)
btrfs: fix races on root_log_ctx lists
btrfs_remove_all_log_ctxs takes a shortcut where it avoids walking the list because it knows all of the waiters are patiently waiting for the commit to finish. But, there's a small race where btrfs_sync_log can remove itself from the list if it finds a log commit is already done. Also, it uses list_del_init() to remove itself from the list, but there's no way to know if btrfs_remove_all_log_ctxs has already run, so we don't know for sure if it is safe to call list_del_init(). This gets rid of all the shortcuts for btrfs_remove_all_log_ctxs(), and just calls it with the proper locking. This is part two of the corruption fixed by cbd60aa7cd1. I should have done this in the first place, but convinced myself the optimizations were safe. A 12 hour run of dbench 2048 will eventually trigger a list debug WARN_ON for the list_del_init() in btrfs_sync_log(). Fixes: d1433debe7f4346cf9fc0dafc71c3137d2a97bc4 Reported-by: Dave Jones <davej@codemonkey.org.uk> cc: stable@vger.kernel.org # 3.15+ Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'Documentation')