# Samba hangs constantly

**URL:** <https://forum.openwrt.org/t/samba-hangs-constantly/130050>\
**Category:** For Developers\
**Created:** [June 17, 2022, 6:46am UTC](https://forum.openwrt.org/t/samba-hangs-constantly/130050 "2022-06-17T06:46:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsipa740](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tsipa740/32/54041_2.png) [@tsipa740](https://forum.openwrt.org/u/tsipa740)\
**Post date:** [June 17, 2022, 6:46am UTC](https://forum.openwrt.org/t/samba-hangs-constantly/130050/1 "2022-06-17T06:46:39Z")

</div>

Hello.

I'm not 100% sure if this is samba fault, nic or something weird around the kernel.

## What i'm doing:

i'm trying to run openwrt on DNS-320. All the support from kernel side already in upstream and works like a charm. I only did some cosmetic changes [https://github.com/tsipa/openwrt/commit/e765c91ff66866c7e782806292893a00c68e4c24](https://github.com/tsipa/openwrt/commit/e765c91ff66866c7e782806292893a00c68e4c24)

## What i'm observing:

samba randomly hangs on reads or writes. This happens very often and it's very repeatable. It happens with files with just few KBs.

## What i have tried:

- Using samba:

- Different client - linux; windows; weird android java implementation. All of them have the same behavior.

- Disabling all possible offloadings from NIC.

- Running client with -d10 [https://paste2.org/GUKWfPwO](https://paste2.org/GUKWfPwO) server with -d2 [https://paste2.org/wKdNk5bI](https://paste2.org/wKdNk5bI)

- Running server with -d10. It simply doesn't work, dunno why. On client side i'm getting "unable to negotiate protocol" when running server with -d \>=3 : client side [https://paste2.org/6hMDpW70](https://paste2.org/6hMDpW70) ; server side [https://paste2.org/M3Z1c58m](https://paste2.org/M3Z1c58m)

- I know that it's not related to disk or fs - i've tried using file from a ramdisk with the same result.

- Dumping traffic from client [https://paste2.org/gxHLI4WU](https://paste2.org/gxHLI4WU) ; dumping same from server: [https://paste2.org/4ebkYg0g](https://paste2.org/4ebkYg0g) i don't see any losses and anything too suspicious.

- I suspect it's not related to L2 network. I've tried:

- I know it's not a hardware issue; without changing the setup:

I would appreciate any suggestions on how to investigate this deeper.

---

<div class="post-metadata">

**Author:** ![tsipa740](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tsipa740/32/54041_2.png) [@tsipa740](https://forum.openwrt.org/u/tsipa740)\
**Post date:** [June 17, 2022, 8:55am UTC](https://forum.openwrt.org/t/samba-hangs-constantly/130050/2 "2022-06-17T08:55:26Z")

</div>

Okay, i managed to run server with -d10. Apparently 4.14.12-1 from releases/21.02.0 works fine with debug enabled.  
This is server side log with timings

> **[Paste2.org - Viewing Paste znIGpGkp](https://paste2.org/znIGpGkp)**
>
> Pastebin style awesomeness - collaborative developing and debugging.

and this is client:

> **[Paste2.org - Viewing Paste 0CzyMKBg](https://paste2.org/0CzyMKBg)**
>
> Pastebin style awesomeness - collaborative developing and debugging.

although it says nothing too obvious to me.

---

<div class="post-metadata">

**Author:** ![tsipa740](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tsipa740/32/54041_2.png) [@tsipa740](https://forum.openwrt.org/u/tsipa740)\
**Post date:** [June 22, 2022, 8:02am UTC](https://forum.openwrt.org/t/samba-hangs-constantly/130050/3 "2022-06-22T08:02:33Z")

</div>

For history: i failed to get it working and i stronly suspect that something is broken beyond repair in samba4 itself. I had to switch to ksmbd.

---

<div class="post-metadata">

**Author:** ![alsg](https://forum.openwrt.org/letter_avatar/alsg/32/6_449c533f586939b6e5f246632a46421f.png) [@alsg](https://forum.openwrt.org/u/alsg)\
**Post date:** [November 30, 2022, 3:36am UTC](https://forum.openwrt.org/t/samba-hangs-constantly/130050/4 "2022-11-30T03:36:32Z")

</div>

Hi, have you manage to resolve the Samba issue? And do you mind sharing the firmware image and installation steps?

I have a D-Link DNS-320 HW A1 model and wanted to give Openwrt a try. Tks.
