File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -484,6 +484,8 @@ static void fuser_run(struct run_queue *rp, const char *fuser_opt)
484484static int fuser_decide (struct run_queue * rp ,
485485 const char * fuser_opt , const char * fuser_kill_prefix )
486486{
487+ static bool has_rc_pid = false;
488+ static char * rc_pid ;
487489 char buf [1 <<12 ];
488490 char selfpid [64 ];
489491 int read_maybe_truncated ;
@@ -505,7 +507,12 @@ static int fuser_decide(struct run_queue *rp,
505507 buf [n + 2 ] = '\0' ;
506508 snprintf (selfpid , sizeof selfpid , " %lld " , (long long )getpid ());
507509
508- if (strstr (buf , selfpid )) {
510+ if (!has_rc_pid ) {
511+ rc_pid = getenv ("RC_PID" );
512+ has_rc_pid = true;
513+ }
514+
515+ if (strstr (buf , selfpid ) || (rc_pid && strstr (buf , rc_pid ))) {
509516 /* lets not kill ourselves */
510517 eerror ("Unmounting %s failed because we are using it" , rp -> mntpath );
511518 return -1 ;
You can’t perform that action at this time.
0 commit comments