/* * netsniff-ng - the packet sniffing beast * Copyright 2013 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include "xmalloc.h" #include "config.h" #include "bpf.h" #include "die.h" void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf, uint32_t link_type) { int i, ret; const struct bpf_insn *ins; struct sock_filter *out; struct bpf_program _bpf; ret = pcap_compile_nopcap(65535, link_type, &_bpf, rulefile, 1, 0xffffffff); if (ret < 0) panic("Cannot compile filter %s\n", rulefile); bpf->len = _bpf.bf_len; bpf->filter = xrealloc(bpf->filter, bpf->len * sizeof(*out)); for (i = 0, ins = _bpf.bf_insns, out = bpf->filter; i < bpf->len; ++i, ++ins, ++out) { out->code = ins->code; out->jt = ins->jt; out->jf = ins->jf; out->k = ins->k; if (out->code == 0x06 && out->k > 0) out->k = 0xFFFFFFFF; } pcap_freecode(&_bpf); if (__bpf_validate(bpf) == 0) panic("This is not a valid BPF program!\n"); } nchange='this.form.submit();'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
on/kobject.txt?h=nds-private-remove&id=8e018c21da3febb558586b48c8db0d6d66cb6593'>kobject.txt
diff options
ModeNameSize
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-08-25 10:09:39 -0700
committerShaohua Li <shli@fb.com>2016-08-31 09:05:18 -0700
commit8e018c21da3febb558586b48c8db0d6d66cb6593 (patch)
tree70d8d62900570c7cade6a7554236f0014ee1e43e /Documentation/kobject.txt
parent86a1679860babbacd61fc1e8c0c0f43641d5860d (diff)
raid5-cache: fix a deadlock in superblock write
There is a potential deadlock in superblock write. Discard could zero data, so before discard we must make sure superblock is updated to new log tail. Updating superblock (either directly call md_update_sb() or depend on md thread) must hold reconfig mutex. On the other hand, raid5_quiesce is called with reconfig_mutex hold. The first step of raid5_quiesce() is waitting for all IO finish, hence waitting for reclaim thread, while reclaim thread is calling this function and waitting for reconfig mutex. So there is a deadlock. We workaround this issue with a trylock. The downside of the solution is we could miss discard if we can't take reconfig mutex. But this should happen rarely (mainly in raid array stop), so miss discard shouldn't be a big problem. Cc: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'Documentation/kobject.txt')