[GH-ISSUE #2024] Cannot work with NFS #1017

Closed
opened 2026-03-04 01:50:40 +03:00 by kerem · 2 comments
Owner

Originally created by @zhan9san on GitHub (Aug 15, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2024

Version of s3fs being used (s3fs --version)

V1.91

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)

2.9.2

Kernel information (uname -r)

3.10.0-1127.el7.x86_64

GNU/Linux Distribution, if applicable (cat /etc/os-release)

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

/etc/fstab entry, if applicable

s3fs#xxx.example.com /mnt/test fuse _netdev,allow_other,use_path_request_style,url=http://s3.us-west-2.amazonaws.com,dbglevel=info,curldbg 0 0

Details about issue

All things work well with s3fs only. But if I export the mount point via nfs, I cannot cp/mv a file from local drive to nfs mount point.

How to reproduce

On NFS server

  1. Create a s3fs mount point on NFS server, /mnt/test
  2. Add /mnt/test into /etc/exports, /mnt/test/backup/tests 10.*.*.*(rw,sync,fsid=11,anonuid=0,anongid=0)
  3. Start nfs server, systemctl start nfs

On NFS client

  1. Create a folder, mkdir /mnt/s3fstest
  2. Mount NFS, mount -t nfs [nfs-server-hostname]:/mnt/test /mnt/s3fstest/
  3. Test

a. Copy a file from local drive to s3fs moun point

touch /tmp/e
cp /tmp/e /mnt/s3fstest/e
cp: cannot create regular file '/mnt/s3fstest/e': No such file or directory

b. Touch a new file

# touch /mnt/s3fstest/e
touch: setting times of '/mnt/s3fstest/e': No such file or directory

c. Move a new file

# mv tmp/e /mnt/s3fstest/e
mv: cannot create regular file '/mnt/s3fstest/e': No such file or directory

d. Create a file thru >

It works

# ls /mnt/s3fstest/e
ls: cannot access '/mnt/s3fstest/e': No such file or directory
# date > /mnt/s3fstest/e
# ls -l /mnt/s3fstest/e
-rw-r----- 1 root root 32 Aug 15 18:29 /mnt/s3fstest/e

e. Create a file thru vim

It works

# ls /mnt/s3fstest/f
ls: cannot access '/mnt/s3fstest/f': No such file or directory
# vim > /mnt/s3fstest/f
# ls -l /mnt/s3fstest/f
-rw-r----- 1 root root 32 Aug 15 18:29 /mnt/s3fstest/f

Summary

Permission is correct because I can create a file thru > and vim.

But it's weird that cp, mv, touch don't work with NFS. And the NFS version would fallback to v3.

Could you give me some suggestions?

Originally created by @zhan9san on GitHub (Aug 15, 2022). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2024 #### Version of s3fs being used (s3fs --version) V1.91 #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) 2.9.2 #### Kernel information (uname -r) 3.10.0-1127.el7.x86_64 #### GNU/Linux Distribution, if applicable (cat /etc/os-release) ```shell # cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" ``` #### /etc/fstab entry, if applicable ``` s3fs#xxx.example.com /mnt/test fuse _netdev,allow_other,use_path_request_style,url=http://s3.us-west-2.amazonaws.com,dbglevel=info,curldbg 0 0 ``` ### Details about issue All things work well with s3fs only. But if I export the mount point via nfs, I cannot cp/mv a file from local drive to nfs mount point. ### How to reproduce #### On NFS server 1. Create a s3fs mount point on NFS server, `/mnt/test` 2. Add `/mnt/test` into `/etc/exports`, `/mnt/test/backup/tests 10.*.*.*(rw,sync,fsid=11,anonuid=0,anongid=0)` 3. Start nfs server, `systemctl start nfs` #### On NFS client 1. Create a folder, `mkdir /mnt/s3fstest` 2. Mount NFS, `mount -t nfs [nfs-server-hostname]:/mnt/test /mnt/s3fstest/` 3. Test a. Copy a file from local drive to s3fs moun point ```shell touch /tmp/e cp /tmp/e /mnt/s3fstest/e cp: cannot create regular file '/mnt/s3fstest/e': No such file or directory ``` b. Touch a new file ``` # touch /mnt/s3fstest/e touch: setting times of '/mnt/s3fstest/e': No such file or directory ``` c. Move a new file ```shell # mv tmp/e /mnt/s3fstest/e mv: cannot create regular file '/mnt/s3fstest/e': No such file or directory ``` d. Create a file thru `>` It works ```shell # ls /mnt/s3fstest/e ls: cannot access '/mnt/s3fstest/e': No such file or directory # date > /mnt/s3fstest/e # ls -l /mnt/s3fstest/e -rw-r----- 1 root root 32 Aug 15 18:29 /mnt/s3fstest/e ``` e. Create a file thru `vim` It works ```shell # ls /mnt/s3fstest/f ls: cannot access '/mnt/s3fstest/f': No such file or directory # vim > /mnt/s3fstest/f # ls -l /mnt/s3fstest/f -rw-r----- 1 root root 32 Aug 15 18:29 /mnt/s3fstest/f ``` ### Summary Permission is correct because I can create a file thru `>` and `vim`. But it's weird that cp, mv, touch don't work with NFS. And the NFS version would fallback to v3. Could you give me some suggestions?
kerem closed this issue 2026-03-04 01:50:40 +03:00
Author
Owner

@ggtakec commented on GitHub (Aug 15, 2022):

Thanks for your report.
I think this issue is the same as #1934, #1957 and #1961, related code fixes are currently in #1964 and #2016.
Please wait fixing codes.

<!-- gh-comment-id:1214999437 --> @ggtakec commented on GitHub (Aug 15, 2022): Thanks for your report. I think this issue is the same as #1934, #1957 and #1961, related code fixes are currently in #1964 and #2016. Please wait fixing codes.
Author
Owner

@ggtakec commented on GitHub (Feb 12, 2023):

@zhan9san
Added update_parent_dir_stat option to update parent directory stat information when file operations are performed.
With this, I think that you can catch file and directory updates when used with NFS.
See #2016 for details.
Try using master's code with the update_parent_dir_stat option.

This issue will be closed, but if you still have problems please reopen it or post a new issue.

<!-- gh-comment-id:1426980640 --> @ggtakec commented on GitHub (Feb 12, 2023): @zhan9san Added `update_parent_dir_stat` option to update parent directory stat information when file operations are performed. With this, I think that you can catch file and directory updates when used with NFS. See #2016 for details. Try using master's code with the `update_parent_dir_stat` option. This issue will be closed, but if you still have problems please reopen it or post a new issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1017
No description provided.