linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/nfs: Use fatal_signal_pending instead of signal_pending
@ 2021-05-10  2:34 zhouchuangao
  0 siblings, 0 replies; 2+ messages in thread
From: zhouchuangao @ 2021-05-10  2:34 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs, linux-kernel, zhouchuangao

We set the state of the current process to TASK_KILLABLE via
prepare_to_wait(). Should we use fatal_signal_pending() to detect
the signal here?

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
 fs/nfs/nfs4proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 87d04f2..0cd9658 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1706,7 +1706,7 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
 		rcu_read_unlock();
 		trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);
 
-		if (!signal_pending(current)) {
+		if (!fatal_signal_pending(current)) {
 			if (schedule_timeout(5*HZ) == 0)
 				status = -EAGAIN;
 			else
@@ -3487,7 +3487,7 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
 		write_sequnlock(&state->seqlock);
 		trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);
 
-		if (signal_pending(current))
+		if (fatal_signal_pending(current))
 			status = -EINTR;
 		else
 			if (schedule_timeout(5*HZ) != 0)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] fs/nfs: Use fatal_signal_pending instead of signal_pending.
@ 2021-04-22  2:51 zhouchuangao
  0 siblings, 0 replies; 2+ messages in thread
From: zhouchuangao @ 2021-04-22  2:51 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, linux-nfs, linux-kernel; +Cc: zhouchuangao

We set the state of the current process to TASK_KILLABLE via
prepare_to_wait(). Should we use fatal_signal_pending() to detect
the signal here?

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
 fs/nfs/nfs4proc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c65c4b4..127be294 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1681,13 +1681,13 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
 		rcu_read_unlock();
 		trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);
 
-		if (!signal_pending(current)) {
+		if (!fatal_signal_pending(current)) {
 			if (schedule_timeout(5*HZ) == 0)
 				status = -EAGAIN;
 			else
 				status = 0;
 		} else
-			status = -EINTR;
+			status = -ERESTARTSYS;
 		finish_wait(&state->waitq, &wait);
 		rcu_read_lock();
 		spin_lock(&state->owner->so_lock);
@@ -3457,8 +3457,8 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
 		write_sequnlock(&state->seqlock);
 		trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);
 
-		if (signal_pending(current))
-			status = -EINTR;
+		if (fatal_signal_pending(current))
+			status = -ERESTARTSYS;
 		else
 			if (schedule_timeout(5*HZ) != 0)
 				status = 0;
@@ -3467,7 +3467,7 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
 
 		if (!status)
 			continue;
-		if (status == -EINTR)
+		if (status == -ERESTARTSYS)
 			break;
 
 		/* we slept the whole 5 seconds, we must have lost a seqid */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-10  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  2:34 [PATCH] fs/nfs: Use fatal_signal_pending instead of signal_pending zhouchuangao
  -- strict thread matches above, loose matches on Subject: below --
2021-04-22  2:51 zhouchuangao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).