/* * Copyright(C) 2015 Linaro Limited. All rights reserved. * Author: Mathieu Poirier * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include #include #include "../../util/auxtrace.h" #include "../../util/evlist.h" #include "../../util/pmu.h" #include "cs-etm.h" struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, int *err) { struct perf_pmu *cs_etm_pmu; struct perf_evsel *evsel; bool found_etm = false; cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME); if (evlist) { evlist__for_each_entry(evlist, evsel) { if (cs_etm_pmu && evsel->attr.type == cs_etm_pmu->type) found_etm = true; } } if (found_etm) return cs_etm_record_init(err); /* * Clear 'err' even if we haven't found a cs_etm event - that way perf * record can still be used even if tracers aren't present. The NULL * return value will take care of telling the infrastructure HW tracing * isn't available. */ *err = 0; return NULL; } aryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-01-20 09:31:54 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2017-01-23 10:55:07 -0800
commitd2b3964a0780d2d2994eba57f950d6c9fe489ed8 (patch)
treee5431a683b41059abd0032aa46685ae78d766a50 /security/integrity/evm/evm_main.c
parent7a308bb3016f57e5be11a677d15b821536419d36 (diff)
xfs: fix COW writeback race
Due to the way how xfs_iomap_write_allocate tries to convert the whole found extents from delalloc to real space we can run into a race condition with multiple threads doing writes to this same extent. For the non-COW case that is harmless as the only thing that can happen is that we call xfs_bmapi_write on an extent that has already been converted to a real allocation. For COW writes where we move the extent from the COW to the data fork after I/O completion the race is, however, not quite as harmless. In the worst case we are now calling xfs_bmapi_write on a region that contains hole in the COW work, which will trip up an assert in debug builds or lead to file system corruption in non-debug builds. This seems to be reproducible with workloads of small O_DSYNC write, although so far I've not managed to come up with a with an isolated reproducer. The fix for the issue is relatively simple: tell xfs_bmapi_write that we are only asked to convert delayed allocations and skip holes in that case. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'security/integrity/evm/evm_main.c')