Skip to content

Commit ab91e7a

Browse files
He ZheTrond Myklebust
authored andcommitted
freezer: Add unsafe versions of freezable_schedule_timeout_interruptible for NFS
commit 0688e64 ("NFS: Allow signal interruption of NFS4ERR_DELAYed operations") introduces nfs4_delay_interruptible which also needs an _unsafe version to avoid the following call trace for the same reason explained in commit 416ad3c ("freezer: add unsafe versions of freezable helpers for NFS") CPU: 4 PID: 3968 Comm: rm Tainted: G W 5.8.0-rc4 #1 Hardware name: Marvell OcteonTX CN96XX board (DT) Call trace: dump_backtrace+0x0/0x1dc show_stack+0x20/0x30 dump_stack+0xdc/0x150 debug_check_no_locks_held+0x98/0xa0 nfs4_delay_interruptible+0xd8/0x120 nfs4_handle_exception+0x130/0x170 nfs4_proc_rmdir+0x8c/0x220 nfs_rmdir+0xa4/0x360 vfs_rmdir.part.0+0x6c/0x1b0 do_rmdir+0x18c/0x210 __arm64_sys_unlinkat+0x64/0x7c el0_svc_common.constprop.0+0x7c/0x110 do_el0_svc+0x24/0xa0 el0_sync_handler+0x13c/0x1b8 el0_sync+0x158/0x180 Signed-off-by: He Zhe <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 4a400f0 commit ab91e7a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static int nfs4_delay_interruptible(long *timeout)
416416
{
417417
might_sleep();
418418

419-
freezable_schedule_timeout_interruptible(nfs4_update_delay(timeout));
419+
freezable_schedule_timeout_interruptible_unsafe(nfs4_update_delay(timeout));
420420
if (!signal_pending(current))
421421
return 0;
422422
return __fatal_signal_pending(current) ? -EINTR :-ERESTARTSYS;

include/linux/freezer.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ static inline long freezable_schedule_timeout_interruptible(long timeout)
207207
return __retval;
208208
}
209209

210+
/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
211+
static inline long freezable_schedule_timeout_interruptible_unsafe(long timeout)
212+
{
213+
long __retval;
214+
215+
freezer_do_not_count();
216+
__retval = schedule_timeout_interruptible(timeout);
217+
freezer_count_unsafe();
218+
return __retval;
219+
}
220+
210221
/* Like schedule_timeout_killable(), but should not block the freezer. */
211222
static inline long freezable_schedule_timeout_killable(long timeout)
212223
{
@@ -285,6 +296,9 @@ static inline void set_freezable(void) {}
285296
#define freezable_schedule_timeout_interruptible(timeout) \
286297
schedule_timeout_interruptible(timeout)
287298

299+
#define freezable_schedule_timeout_interruptible_unsafe(timeout) \
300+
schedule_timeout_interruptible(timeout)
301+
288302
#define freezable_schedule_timeout_killable(timeout) \
289303
schedule_timeout_killable(timeout)
290304

0 commit comments

Comments
 (0)