Skip to content

Commit dc0f270

Browse files
cmd/mount: Add fuse opt ReadDirPlusAuto. (#6299)
1 parent 84423b3 commit dc0f270

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ require (
313313

314314
replace github.com/minio/minio v0.0.0-20210206053228-97fe57bba92c => github.com/juicedata/minio v0.0.0-20250321080125-0f92d5f311b8
315315

316-
replace github.com/hanwen/go-fuse/v2 v2.1.1-0.20210611132105-24a1dfe6b4f8 => github.com/juicedata/go-fuse/v2 v2.1.1-0.20250509085345-58f40c5d2ed9
316+
replace github.com/hanwen/go-fuse/v2 v2.1.1-0.20210611132105-24a1dfe6b4f8 => github.com/juicedata/go-fuse/v2 v2.1.1-0.20250807045235-112198daa7df
317317

318318
replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt v3.2.1+incompatible
319319

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ github.com/juicedata/cli/v2 v2.19.4-0.20230605075551-9c9c5c0dce83 h1:RyHTka3jCnT
470470
github.com/juicedata/cli/v2 v2.19.4-0.20230605075551-9c9c5c0dce83/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
471471
github.com/juicedata/go-colorable v0.0.0-20250208072043-a97a0c2023db h1:esc0bVXkjEuyPLn7JXFhKBDztpM0dT0GYQn7CqaBB6w=
472472
github.com/juicedata/go-colorable v0.0.0-20250208072043-a97a0c2023db/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
473-
github.com/juicedata/go-fuse/v2 v2.1.1-0.20250509085345-58f40c5d2ed9 h1:nwpDwi2fQj6GVm3XVWgl/fSGON0ihLvZep+hNhZEy54=
474-
github.com/juicedata/go-fuse/v2 v2.1.1-0.20250509085345-58f40c5d2ed9/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
473+
github.com/juicedata/go-fuse/v2 v2.1.1-0.20250807045235-112198daa7df h1:H3/AM/YZGPitgptMKBn3WrvWj7UrlhJSMHx4BrjuXMo=
474+
github.com/juicedata/go-fuse/v2 v2.1.1-0.20250807045235-112198daa7df/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
475475
github.com/juicedata/go-nfs-client v0.0.0-20250220101412-d3a8c1ca64a1 h1:GgH2ZG9inMYSme7zZb79z3QeOW70YusbJIVYjvqd508=
476476
github.com/juicedata/go-nfs-client v0.0.0-20250220101412-d3a8c1ca64a1/go.mod h1:xOMqi3lOrcGe9uZLnSzgaq94Vc3oz6VPCNDLJUnXpKs=
477477
github.com/juicedata/godaemon v0.0.0-20210629045518-3da5144a127d h1:kpQMvNZJKGY3PTt7OSoahYc4nM0HY67SvK0YyS0GLwA=

pkg/fuse/fuse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ func Serve(v *vfs.VFS, options string, xattrs, ioctl bool) error {
472472
opt.DirectMount = true
473473
opt.AllowOther = os.Getuid() == 0
474474
opt.Timeout = conf.FuseOpts.Timeout
475+
opt.EnableReadDirPlusAuto = conf.FuseOpts.EnableReadDirPlusAuto
475476

476477
if opt.EnableAcl && conf.NonDefaultPermission {
477478
logger.Warnf("it is recommended to turn on 'default-permissions' when enable acl")
@@ -549,6 +550,7 @@ func GenFuseOpt(conf *vfs.Config, options string, mt int, noxattr, noacl bool, m
549550
opt.DirectMount = true
550551
opt.DontUmask = true
551552
opt.Timeout = time.Minute * 15
553+
opt.EnableReadDirPlusAuto = true
552554
for _, n := range strings.Split(options, ",") {
553555
// TODO allow_root
554556
if n == "allow_other" {

pkg/vfs/vfs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type FuseOptions struct {
7777
DirectMountFlags uintptr
7878
EnableAcl bool
7979
DisableReadDirPlus bool `json:",omitempty"`
80+
EnableReadDirPlusAuto bool
8081
EnableWriteback bool
8182
EnableIoctl bool `json:",omitempty"`
8283
DontUmask bool

0 commit comments

Comments
 (0)