Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1492363
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.7 06/69] ocfs2/dlm: fix race between convert and migration |
| Date | 2016-09-28 11:10 +0200 |
| Message-ID | <smj2i-4LM-29@gated-at.bofh.it> (permalink) |
| References | <smj2h-4LM-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@huawei.com>
commit e6f0c6e6170fec175fe676495f29029aecdf486c upstream.
Commit ac7cf246dfdb ("ocfs2/dlm: fix race between convert and recovery")
checks if lockres master has changed to identify whether new master has
finished recovery or not. This will introduce a race that right after
old master does umount ( means master will change), a new convert
request comes.
In this case, it will reset lockres state to DLM_RECOVERING and then
retry convert, and then fail with lockres->l_action being set to
OCFS2_AST_INVALID, which will cause inconsistent lock level between
ocfs2 and dlm, and then finally BUG.
Since dlm recovery will clear lock->convert_pending in
dlm_move_lockres_to_recovery_list, we can use it to correctly identify
the race case between convert and recovery. So fix it.
Fixes: ac7cf246dfdb ("ocfs2/dlm: fix race between convert and recovery")
Link: http://lkml.kernel.org/r/57CE1569.8010704@huawei.com
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Jun Piao <piaojun@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ocfs2/dlm/dlmconvert.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/fs/ocfs2/dlm/dlmconvert.c
+++ b/fs/ocfs2/dlm/dlmconvert.c
@@ -268,7 +268,6 @@ enum dlm_status dlmconvert_remote(struct
struct dlm_lock *lock, int flags, int type)
{
enum dlm_status status;
- u8 old_owner = res->owner;
mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type,
lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS);
@@ -335,7 +334,6 @@ enum dlm_status dlmconvert_remote(struct
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
- lock->convert_pending = 0;
/* if it failed, move it back to granted queue.
* if master returns DLM_NORMAL and then down before sending ast,
* it may have already been moved to granted queue, reset to
@@ -344,12 +342,14 @@ enum dlm_status dlmconvert_remote(struct
if (status != DLM_NOTQUEUED)
dlm_error(status);
dlm_revert_pending_convert(res, lock);
- } else if ((res->state & DLM_LOCK_RES_RECOVERING) ||
- (old_owner != res->owner)) {
- mlog(0, "res %.*s is in recovering or has been recovered.\n",
- res->lockname.len, res->lockname.name);
+ } else if (!lock->convert_pending) {
+ mlog(0, "%s: res %.*s, owner died and lock has been moved back "
+ "to granted list, retry convert.\n",
+ dlm->name, res->lockname.len, res->lockname.name);
status = DLM_RECOVERING;
}
+
+ lock->convert_pending = 0;
bail:
spin_unlock(&res->spinlock);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.7 00/69] 4.7.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:10 +0200
[PATCH 4.7 06/69] ocfs2/dlm: fix race between convert and migration Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:10 +0200
[PATCH 4.7 56/69] PM / hibernate: Restore processor state before using per-CPU variables Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 47/69] MIPS: Remove compact branch policy Kconfig entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 12/69] Makefile: Mute warning for __builtin_return_address(>0) for tracing only Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 66/69] kasan: avoid overflowing quarantine size on low memory systems Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 52/69] libceph: add an ONSTACK initializer for oids Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 38/69] btrfs: ensure that file descriptor used with subvol ioctls is a dir Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 57/69] PM / hibernate: Fix rtree_next_node() to avoid walking off list ends Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 51/69] x86/mm/pat: Prevent hang during boot when mapping pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 68/69] iw_cxgb4: stop MPA_REPLY timer when disconnecting Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 32/69] tracing: Move mutex to protect against resetting of seq data Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 13/69] xfs: prevent dropping ioend completions during buftarg wait Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 64/69] qxl: check for kmap failures Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 43/69] i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 27/69] reset: Return -ENOTSUPP when not configured Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 45/69] MIPS: SMP: Fix possibility of deadlock when bringing CPUs online Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 09/69] autofs: use dentry flags to block walks during expire Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 49/69] MIPS: Add a missing ".set pop" in an early commit Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 34/69] can: flexcan: fix resume function Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 62/69] igb: fix adjusting PTP timestamps for Tx/Rx latency Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 10/69] Disable "maybe-uninitialized" warning globally Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 61/69] ixgbe: Re-enable ability to toggle VLAN filtering Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 53/69] ceph: fix symbol versioning for ceph_monc_do_statfs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 40/69] irqchip/mips-gic: Fix local interrupts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 46/69] MIPS: vDSO: Fix Malta EVA mapping to vDSO page structs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 29/69] power: reset: hisi-reboot: Unmap region obtained by of_iomap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 41/69] i2c-eg20t: fix race between i2c init and interrupt enable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 60/69] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 55/69] libceph: fix return value check in alloc_msg_with_page_vector() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 65/69] hostfs: Freeing an ERR_PTR in hostfs_fill_sb_common() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 59/69] power: supply: max17042_battery: fix model download bug. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 67/69] mm/kasan: dont reduce quarantine in atomic contexts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 44/69] MIPS: Fix pre-r6 emulation FPU initialisation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 48/69] MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 58/69] power_supply: tps65217-charger: fix missing platform_set_drvdata() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 37/69] nl80211: validate number of probe response CSA counters Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 07/69] ocfs2: fix start offset to ocfs2_zero_range_for_truncate() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 35/69] net: can: ifi: Configure transmitter delay Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 42/69] i2c: mux: pca954x: retry updating the mux selection on failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 63/69] soc/tegra: pmc: Dont probe PMC if early initialisation fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:20 +0200
[PATCH 4.7 25/69] mtd: pmcmsp-flash: Allocating too much in init_msp_flash() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 36/69] iwlwifi: mvm: update TX queue before making a copy of the skb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 22/69] configfs: Return -EFBIG from configfs_write_bin_file. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 26/69] mtd: spi-nor: fix wrong "fully unlocked" test Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 31/69] fix memory leaks in tracing_buffers_splice_read() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 20/69] KEYS: Fix skcipher IV clobbering Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 16/69] fanotify: fix list corruption in fanotify_get_response() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 30/69] mac80211: reject TSPEC TIDs (TSIDs) for aggregation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 18/69] cgroup: duplicate cgroup reference when cloning sockets Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 19/69] fix fault_in_multipages_...() on architectures with no-op access_ok() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 17/69] mm: memcontrol: make per-cpu charge cache IRQ-safe for socket accounting Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 15/69] fsnotify: add a way to stop queueing events on group shutdown Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 33/69] mm: delete unnecessary and unsafe init_tlb_ubc() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 08/69] Revert "ocfs2: bump up o2cb network protocol version" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 28/69] rtc: ds1307: Fix relying on reset value for weekday Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 14/69] mm: fix the page_swap_info() BUG_ON check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 39/69] x86/efi: Only map RAM into EFI page tables if in mixed-mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 24/69] mtd: maps: sa1100-flash: potential NULL dereference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 50/69] MIPS: paravirt: Fix undefined reference to smp_bootstrap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 54/69] ceph: Correctly return NXIO errors from ceph_llseek Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 21/69] arm64: Call numa_store_cpu_info() earlier. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:30 +0200
[PATCH 4.7 04/69] crypto: skcipher - Fix blkcipher walk OOM crash Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-28 11:40 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-09-28 18:50 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-29 11:10 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Guenter Roeck <linux@roeck-us.net> - 2016-09-29 00:50 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-29 11:10 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-29 10:40 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Kevin Hilman <khilman@baylibre.com> - 2016-09-29 16:50 +0200
Re: [PATCH 4.7 00/69] 4.7.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-29 17:30 +0200
csiph-web