Repository: kubernetes
Issue: Set TerminationMessagePath to a Path Under Bidirectional Mounted EmptyDir Blocking the Pod Deleting.
Labels: kind/bug,sig/storage,sig/node,priority/important-longterm,triage/accepted

### What happened?

I have a pod writing the termination message into an empty dir volume with bidirectional mount propagation, every time I delete the pod, the pod will stuck at terminating, and I have to do a force deletion. the logs of kubelet showing something like
> UnmountVolume.TearDown failed for volume "cache-volume" (UniqueName:
 "kubernetes.io/empty-dir/44ae6082-160d-442e-8234-a2b85905b19c-cache-volume") pod "44ae6082-160d-442e-8234-a2b85905b19c" (UID: "44ae6082-160d-442e-8234-a2b85905b19c") : unlinkat /var/lib/kubelet/pods/44ae6082-160d-442e-8234-a2b85905b19c/volumes/kubernetes.io~empty-dir/cache-volume/log.txt: device or resource busy

### What did you expect to happen?

The pod can be deleted without force deletion, and the mount point, empty directory on the node running the pod should be cleared.

### How can we reproduce it (as minimally and precisely as possible)?

Apply the following yaml, and delete the pod.
```yaml
apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  restartPolicy: Never
  containers:
  - image: ubuntu
    name: test-container
    command:
    - bash
    - "-c"
    - "/script/test.sh"
    volumeMounts:
    - mountPath: /cache
      name: cache-volume
      mountPropagation: Bidirectional
    - mountPath: /script
      name: script
    terminationMessagePath: /cache/log.txt
    terminationMessagePolicy: FallbackToLogsOnError
    securityContext:
      privileged: true
  volumes:
  - name: cache-volume
    emptyDir: {}
  - name: script
    configMap:
      name: test-config
      items:
      - key: test.sh
        path: test.sh
        mode: 0777
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: test-config
data:
  test.sh: |
    #!/bin/bash
    trap "echo 'SIGTERM received, gracefully shutting down'; echo 'shutdown logs...' > /cache/log.txt; exit 0" SIGTERM
    for i in {1..100000000}
    do
      echo "test $i"
      sleep 1
    done
```

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.2", GitCommit:"5835544ca568b757a8ecae5c153f317e5736700e", GitTreeState:"clean", BuildDate:"2022-09-21T14:33:49Z", GoVersion:"go1.19.1", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.6", GitCommit:"c86d003ea699ec4bcffee10ad563a26b63561c0e", GitTreeState:"clean", BuildDate:"2022-12-17T10:31:53Z", GoVersion:"go1.18.6", Compiler:"gc", Platform:"linux/amd64"}
```

</details>


### Cloud provider

<details>
Azure AKS
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ uname -a
Linux xxx-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>