diff options
Diffstat (limited to 'debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch')
-rw-r--r-- | debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index e270b7b41..e476c36ee 100644 --- a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,22 +5,23 @@ Cc: Anna Schumaker <anna.schumaker@netapp.com>, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.17-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz -The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me -because it maps to preempt_disable() in -RT which I can't have at this -point. So I took a look at the code. -It the lockdep part was removed in commit abbec2da13f0 ("NFS: Use -raw_write_seqcount_begin/end int nfs4_reclaim_open_state") because -lockdep complained. The whole seqcount thing was introduced in commit -c137afabe330 ("NFSv4: Allow the state manager to mark an open_owner as -being recovered"). +The raw_write_seqcount_begin() in nfs4_reclaim_open_state() causes a +preempt_disable() on -RT. The spin_lock()/spin_unlock() in that section does +not work. +The lockdep part was removed in commit + abbec2da13f0 ("NFS: Use raw_write_seqcount_begin/end int nfs4_reclaim_open_state") +because lockdep complained. +The whole seqcount thing was introduced in commit + c137afabe330 ("NFSv4: Allow the state manager to mark an open_owner as being recovered"). The recovery threads runs only once. write_seqlock() does not work on !RT because it disables preemption and it the writer side is preemptible (has to remain so despite the fact that it will block readers). Reported-by: kernel test robot <xiaolong.ye@intel.com> +Link: https://lkml.kernel.org/r/20161021164727.24485-1-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- fs/nfs/delegation.c | 4 ++-- @@ -31,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c -@@ -152,11 +152,11 @@ static int nfs_delegation_claim_opens(st +@@ -162,11 +162,11 @@ static int nfs_delegation_claim_opens(st sp = state->owner; /* Block nfs4_proc_unlck */ mutex_lock(&sp->so_delegreturn_mutex); @@ -58,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2926,7 +2926,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2956,7 +2956,7 @@ static int _nfs4_open_and_get_state(stru unsigned int seq; int ret; @@ -67,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = _nfs4_proc_open(opendata, ctx); if (ret != 0) -@@ -2967,7 +2967,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2998,7 +2998,7 @@ static int _nfs4_open_and_get_state(stru if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); @@ -87,11 +88,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1633,8 +1633,12 @@ static int nfs4_reclaim_open_state(struc +@@ -1618,8 +1618,12 @@ static int nfs4_reclaim_open_state(struc * recovering after a network partition or a reboot from a * server that doesn't support a grace period. */ -+#ifdef CONFIG_PREEMPT_RT_FULL ++#ifdef CONFIG_PREEMPT_RT + write_seqlock(&sp->so_reclaim_seqlock); +#else + write_seqcount_begin(&sp->so_reclaim_seqlock.seqcount); @@ -101,13 +102,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1695,14 +1699,20 @@ static int nfs4_reclaim_open_state(struc +@@ -1680,14 +1684,20 @@ static int nfs4_reclaim_open_state(struc spin_lock(&sp->so_lock); goto restart; } - raw_write_seqcount_end(&sp->so_reclaim_seqcount); spin_unlock(&sp->so_lock); -+#ifdef CONFIG_PREEMPT_RT_FULL ++#ifdef CONFIG_PREEMPT_RT + write_sequnlock(&sp->so_reclaim_seqlock); +#else + write_seqcount_end(&sp->so_reclaim_seqlock.seqcount); @@ -118,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - spin_lock(&sp->so_lock); - raw_write_seqcount_end(&sp->so_reclaim_seqcount); - spin_unlock(&sp->so_lock); -+#ifdef CONFIG_PREEMPT_RT_FULL ++#ifdef CONFIG_PREEMPT_RT + write_sequnlock(&sp->so_reclaim_seqlock); +#else + write_seqcount_end(&sp->so_reclaim_seqlock.seqcount); |