From nobody Fri Nov 28 17:47:31 2025 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ13V3JPtz6Hwr7 for ; Fri, 28 Nov 2025 17:47:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ13V1WVMz3FfX for ; Fri, 28 Nov 2025 17:47:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-3436d6ca17bso2073114a91.3 for ; Fri, 28 Nov 2025 09:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1764352064; x=1764956864; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BHVvk7yDUI9ZSU2Kx0kBHDd68MQVN3+lTz2fgn1fmew=; b=zvpipLD/AI2kswueuyTkVea7BWQpD/tzXt0DO2pFqx1mt8bOh6pmuapx2lHRXHNmVk jARrF/WdANqhzH8whWvR0xW7v3SWcQK34OvQW28yXvSSm52Y5FlDB0TgPoflSUEREo1B hdQ1Ga0ExOIS94gUuSToQhGOX3+AWUyC/TmRuSEo27lM+r/c33jNs4uabjjDd7l0x8Qt BrSamVwoedadWHpVS9m0a7Acxl/yj6vlGbyVZ0figZfHCc375I8fJOBDxziP7X68+e35 B+LhN2JuYS+c/nRFlXYvjlND/xlT1jLB8URXYaemXJLQrfk8lqlqK50ijmkvAVoagsZa E2iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764352064; x=1764956864; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BHVvk7yDUI9ZSU2Kx0kBHDd68MQVN3+lTz2fgn1fmew=; b=X9GBwF/8/rHqQGHVGOMYALvrkSZmL4ozyuOTdYxRB8840e4oqTqLp7N9xsv5xS/wyW +LFHJA/5tJ9dujQTT8Qn+5R8OI4+jHIIPbw5Hd8q/hHPubHOh4GVmVaTtNfFdu1qz4Pq zPBuBSJ7O/YP2gMOsZu2Wxe3/UZ6FdA6psi8f+xUBpxzID7Ns7sIGN+jvl8+SG3bCKO2 9H/lp6B18sS8y4ZkrwYNJok5V9/ITA+z46WwbTXontp51d1HScQfQPvxN/BnLj9uPFSA oYLjGmEeziTrvxf4SL96Scc/cbAsGKvJNlbBcKjFNB63TLX4oLNH0b/tK93ORGdkYSp6 yMag== X-Gm-Message-State: AOJu0YxxDQOi/bDhMIWSDVOk2iLmXXAwcc2foj8aI9BC7WJaExvuG6lb jXHO9GypaB/iuyAola7H3sseNjUwbcxj02lh3K5oWlZut/EFjmtRZ3p524zYjr+cwdJhV94Prxz khlZ3qJJNjRz7vNQmE6GBKJKWcaMpVcH1hNgHJtg7/H1NqAba7N/4VL8= X-Gm-Gg: ASbGnctY2S7XImjRYUS2LugPMc50N9gVjRyTiv3CpOwhlUx+DFRKtD7Tl96hZoIQUao zD3+X3indqXgjvxRN7A8E54QcQmoe73j75v9t97IobnMlIbwGJ0hyJN7XxicGDx+kY8MoaVRauc 2ZrPf20Wtv1CyTUR9kfmCY6CbjJLv78w86NJ4SK/pwaH0eaO8PU+qVVBW3mnAHV7R2wjQI+qPJZ wxrVsA3RvXMNI6Tnd5oBgYyity3lnaQerU5xOHJe9/r8QAaHI2Wns9WD8ggl30XzONnThc= X-Google-Smtp-Source: AGHT+IFVfgctuQJhbI+SuyaS6iz4utQ2A3s2XzGECJMwF+oFYL1XAknZDblrDy4NUMLxM8eqkIvSXrH6uQhpagVXGNw= X-Received: by 2002:a17:90b:3e87:b0:340:a1a8:eb87 with SMTP id 98e67ed59e1d1-34733f4f4bamr31904656a91.35.1764352063902; Fri, 28 Nov 2025 09:47:43 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <458400081.20251126171621.ref@yahoo.com> <458400081.20251126171621@yahoo.com> <908785764.20251127131317@yahoo.com> <1777092313.20251128124844@yahoo.com> In-Reply-To: <1777092313.20251128124844@yahoo.com> From: Warner Losh Date: Fri, 28 Nov 2025 10:47:31 -0700 X-Gm-Features: AWmQ_bkewTrxufH6WYpdJQiiE5xJ5tzJDy2f0TPF2G2CYLPDqblqrINot1N27cw Message-ID: Subject: Re: any way to recover from I/O hang? To: Anthony Pankov Cc: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="00000000000007262e0644ab3ad4" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dJ13V1WVMz3FfX --00000000000007262e0644ab3ad4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 28, 2025 at 2:48=E2=80=AFAM Anthony Pankov wrote: > > Friday, November 28, 2025, 1:06:19 AM, you wrote: > > > Without a wchan waiter or tracebacks, I can't help at all. Nothing you'= ve > > said is actionable, alas. umount should clear everything up, but if > you've > > hit some bug where the I/O never completes due to deadlock, nothing can > > help you... except maybe tracebacks to we can understand what that > deadlock > > might be. > > I wander do kernel care about infinite I/O waiting? Yes. We try really hard never to wait forever. Waiting forever is a bug. However, there's no way to solve it generically, though. There's no common choke point to use, nor any way to really communicate the underlying system is gone. It all depends on the exact specifics what's wrong and how to fix it. > Neither the problem nor previous situation with ggate doesn't seem like a > deadlock for me. > They are. Whether they seem to you or not, failing to wakeup sleepers is by definition a deadlock. It might not be, exactly, two locked processes waiting for another process to be able to make progress, but it is something that's leaving dangling resources that it didn't clean up and if you don't know why, you can't prevent it in the future. > If I remember correctly with ggate reviving ggate server do revive > 'hanged' client which also was unresponsible to -KILL and 'umount -f'. > I can't debug rumors. I hate to be harsh, but this isn't helpful. It's too vague to be actionable or to explain exactly what happened to bring that situation about at a micro-level. > Anyway I think it's very desirable that 'umount -f' will apply more > force and not give up with "device busy" message. > Yes. I believe in motherhood and apple pie too. I'm wanting to do something to fix any issues we still have here. > I partially understand that "more force" is a complex problem. May be of > something like replacing mountpoint vnode structures by deadfs structures= . Without knowing what the problem is, it's impossible to know if this would work or not. We have to know the specifics in order to know what's going on. We already have all that stuff in place, but if something is sleeping and nobody ever wakes it up, there's nothing to be done except fix that bug. Tossing vague notions about what should be done isn't helpful. Next time this happens, please please please panic the system, take a core dump and contact me so I can get a kernel, the debug symbols and the crash dump to look at. It would be even better if sources / source hash was available. Warner > > On Thu, Nov 27, 2025 at 3:13=E2=80=AFAM Anthony Pankov > > wrote: > > >> > >> Thursday, November 27, 2025, 7:58:21 AM, you wrote: > >> > >> > On Wed, Nov 26, 2025 at 7:16=E2=80=AFAM Anthony Pankov < > anthony.pankov@yahoo.com > >> > > >> > wrote: > >> > >> >> > >> >> Recently I'm again facing a situation where some UFS (?) error on o= ne > >> >> partition forced me to reboot whole server and interrupt people's > work. > >> >> As I understand the brief is: > >> >> > >> >> Reason: A process in state 'D' (uninterruptible wait/sleep) is > blocked > >> on > >> >> an I/O operation (e.g., waiting for a network file share, a disk > >> operation, > >> >> or a device that is no longer responding) at the kernel level. The > >> process > >> >> is not awaken to handle signals until the condition it is waiting > for is > >> >> resolved. > >> >> Solution: You cannot kill a 'D' state process with any signal, > including > >> >> SIGKILL (kill -9). The condition must be resolved (e.g., fixing the > >> network > >> >> connection, waiting for the I/O to time out, or potentially > unmounting > >> the > >> >> filesystem with umount -f if it's a mounted network share). In some > rare > >> >> cases involving buggy kernel code or hardware failure, a reboot may > be > >> the > >> >> only option. > >> >> > >> >> In my case there was a jailed samba which share one ufs-formatted > >> >> partition. The samba processes hangs one by one and sharing has > stopped > >> it > >> >> work. > >> >> There was no message in log. Geom reported no errors. Disk's has no > >> error. > >> >> It seems that there was some introduced inconsistency in UFS. > >> >> My thoughts was to stop/kill samba, remove samba's jail, unmount > >> partition > >> >> and do fsck. > >> >> > >> >> But 'jail -r' exit with something 'rc.shutdown exited ... 9' and le= ft > >> jail > >> >> running. pskill -KILL for samba processes say nothing and do nothin= g. > >> >> 'umount -f' say 'Device is busy'. Various utilities such as 'df' > hangs. > >> So > >> >> I forced to shutdown the server which has other important and > workable > >> >> service to resolve the situation. > >> >> > >> >> I wander is there any way to treat such a cases? May be 'umount -f' > can > >> >> have more power... > >> >> > >> > >> > So no errors from geom? Or from CAM? what's the underlying storage > >> > hardware? And what's the wchan / straceback for the processes in 'D' > >> state? > >> > And do you know the location of the file that's waiting for I/O? > >> > >> No errors. UFS was on gmirror and 'gmirror status' said 'OK'. > >> Unfortunately I was unable to do meaningful investigation under stress= . > >> There was a number of smbd process in a jail which ignore killing and > >> anything else. > >> The first inconsistency found by fsck later was a file with mtime > >> corresponding to a first claim of a problem from one user. Hour later > there > >> was more claims and finally samba share stop working. As I understand > UFS > >> inconsistency grew over that hour. Because there was multiple smbd > >> processes each corresponding to different user there it is no one file > >> maked problem. > >> > >> > >> > There's a number of things that might cause this, but they typically > are > >> > noisy about it. There's a couple of deadlock issues that might cause > >> this, > >> > but getting some more information is needed to understand what might > be > >> > done to mitigate or prevent the deadlocks. > >> > >> > P.S. Previous situation was when I do simple (as I think) experiment= s > >> with > >> >> ggated and have forced to reboot server when 'mount' hung. > >> >> > >> > >> > I assume ggate isn't involved when this happens now, right? > >> > >> That's right. I note this because it seems that stoping ggate server > >> while running ggate client is the simplest way to reproduce the proble= m. > >> > >> P.S. I was really hope that "umount -f" awake waiting processes for > >> killing. > >> > >> > >> > >> > >> >> -- > >> >> Best regards, > >> >> Anthony Pankov mailto: > anthony.pankov@yahoo.com > >> >> > >> >> > >> >> > >> > >> > >> -- > >> Best regards, > >> Anthony > >> > >> > > > -- > Best regards, > Anthony > > --00000000000007262e0644ab3ad4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Nov 28,= 2025 at 2:48=E2=80=AFAM Anthony Pankov <anthony.pankov@yahoo.com> wrote:

Friday, November 28, 2025, 1:06:19 AM, you wrote:

> Without a wchan waiter or tracebacks, I can't help at all. Nothing= you've
> said is actionable, alas. umount should clear everything up, but if yo= u've
> hit some bug where the I/O never completes due to deadlock, nothing ca= n
> help you... except maybe tracebacks to we can understand what that dea= dlock
> might be.

I wander do kernel care about infinite I/O waiting?

Yes. We try really hard never to wait forever. Waiting forever is = a bug. However, there's no way to solve it generically, though. There&#= 39;s no common choke point to use, nor any way to really communicate the un= derlying system is gone. It all depends on the exact specifics what's w= rong and how to fix it.
=C2=A0
Neither the problem nor previous situation with ggate = doesn't seem like a deadlock for me.

They are. Whether they seem to you or not, failing to wakeup=C2=A0sleeper= s is by definition a deadlock. It might not be, exactly, two locked process= es waiting for another process to be able to make progress, but it is somet= hing that's leaving dangling resources that it didn't clean up and = if you don't know why, you can't prevent it in the future.
=C2=A0
If I remember correctly with ggate reviving ggate server do revive 'han= ged' client which also was unresponsible to -KILL and 'umount -f= 9;.

I can't debug rumors. I hate to= be harsh, but this isn't helpful. It's too vague to be actionable = or to explain exactly what happened to bring that situation about at a micr= o-level.
=C2=A0
Anyway I think it's very desirable that=C2=A0 'umount -f'=C2=A0= will apply more force and not give up with "device busy" message= .

Yes. I believe in motherhood and appl= e pie too. I'm wanting to do something to fix any issues we still have = here.
=C2=A0
I partially understand that "more force" is a complex problem. Ma= y be of something like replacing mountpoint vnode structures by deadfs stru= ctures.

Without knowing what the problem is= , it's impossible to know if this would work or not. We have to know th= e specifics in order to know what's going on. We already have all that = stuff in place, but if something is sleeping and nobody ever wakes it up, t= here's nothing to be done except fix that bug. Tossing vague notions ab= out what should be done isn't helpful.

Next ti= me this happens, please please please panic the system, take a core dump an= d contact me so=C2=A0I can get a kernel, the debug symbols and the crash du= mp to=C2=A0look at. It would be even better if sources / source hash was av= ailable.

Warner
=C2=A0
=C2=A0
> On Thu, Nov 27, 2025 at 3:13=E2=80=AFAM Anthony Pankov <anthony.pankov@yahoo.com= >
> wrote:

>>
>> Thursday, November 27, 2025, 7:58:21 AM, you wrote:
>>
>> > On Wed, Nov 26, 2025 at 7:16=E2=80=AFAM Anthony Pankov <anthony.pankov@= yahoo.com
>> >
>> > wrote:
>>
>> >>
>> >> Recently I'm again facing a situation where some UFS = (?) error on one
>> >> partition forced me to reboot whole server and interrupt = people's work.
>> >> As I understand the brief is:
>> >>
>> >> Reason: A process in state 'D' (uninterruptible w= ait/sleep) is blocked
>> on
>> >> an I/O operation (e.g., waiting for a network file share,= a disk
>> operation,
>> >> or a device that is no longer responding) at the kernel l= evel. The
>> process
>> >> is not awaken to handle signals until the condition it is= waiting for is
>> >> resolved.
>> >> Solution: You cannot kill a 'D' state process wit= h any signal, including
>> >> SIGKILL (kill -9). The condition must be resolved (e.g., = fixing the
>> network
>> >> connection, waiting for the I/O to time out, or potential= ly unmounting
>> the
>> >> filesystem with umount -f if it's a mounted network s= hare). In some rare
>> >> cases involving buggy kernel code or hardware failure, a = reboot may be
>> the
>> >> only option.
>> >>
>> >> In my case there was a jailed samba which share one ufs-f= ormatted
>> >> partition. The samba processes hangs one by one and shari= ng has stopped
>> it
>> >> work.
>> >> There was no message in log. Geom reported no errors. Dis= k's has no
>> error.
>> >> It seems that there was some introduced inconsistency in = UFS.
>> >> My thoughts was to stop/kill samba, remove samba's ja= il, unmount
>> partition
>> >> and do fsck.
>> >>
>> >> But 'jail -r' exit with something 'rc.shutdow= n exited ... 9' and left
>> jail
>> >> running. pskill -KILL for samba processes say nothing and= do nothing.
>> >> 'umount -f' say 'Device is busy'. Various= utilities such as 'df' hangs.
>> So
>> >> I forced to shutdown the server which has other important= and workable
>> >> service to resolve the situation.
>> >>
>> >> I wander is there any way to treat such a cases? May be &= #39;umount -f' can
>> >> have more power...
>> >>
>>
>> > So no errors from geom? Or from CAM? what's the underlyin= g storage
>> > hardware? And what's the wchan / straceback for the proce= sses in 'D'
>> state?
>> > And do you know the location of the file that's waiting f= or I/O?
>>
>> No errors. UFS was on gmirror and 'gmirror status' said &#= 39;OK'.
>> Unfortunately I was unable to do meaningful investigation under st= ress.
>> There was a number of smbd process in a jail which ignore killing = and
>> anything else.
>> The first inconsistency found by fsck later was=C2=A0 a file with = mtime
>> corresponding to a first claim of a problem from one user. Hour la= ter there
>> was more claims and finally samba share stop working.=C2=A0 As I u= nderstand UFS
>> inconsistency grew over that hour. Because there was multiple smbd=
>> processes each corresponding to different user there it is no one = file
>> maked problem.
>>
>>
>> > There's a number of things that might cause this, but the= y typically are
>> > noisy about it. There's a couple of deadlock issues that = might cause
>> this,
>> > but getting some more information is needed to understand wha= t might be
>> > done to mitigate or prevent the deadlocks.
>>
>> > P.S. Previous situation was when I do simple (as I think) exp= eriments
>> with
>> >> ggated and have forced to reboot server when 'mount&#= 39; hung.
>> >>
>>
>> > I assume ggate isn't involved when this happens now, righ= t?
>>
>> That's right.=C2=A0 I note this because it seems that stoping = ggate server
>> while running ggate client is the simplest way to reproduce the pr= oblem.
>>
>> P.S. I was really hope that "umount -f" awake waiting pr= ocesses for
>> killing.
>>
>>
>>
>>
>> >> --
>> >> Best regards,
>> >>=C2=A0 Anthony Pankov=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mailto:anthony.pankov@yahoo.com
>> >>
>> >>
>> >>
>>
>>
>> --
>> Best regards,
>> Anthony
>>
>>


--
Best regards,
Anthony

--00000000000007262e0644ab3ad4--