Skip to content

Commit

Permalink
mount: fix upgrade with xattr (#4450)
Browse files Browse the repository at this point in the history
  • Loading branch information
davies authored Mar 6, 2024
1 parent bb09f37 commit 849ccc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,13 @@ func shutdownGraceful(mp string) {
}
fuseFd, fuseSetting = getFuseFd(conf.CommPath)
if fuseFd == 0 {
logger.Warnf("recv FUSE fd from existing client")
logger.Warnf("fail to recv FUSE fd from %s", conf.CommPath)
return
}
for i := 0; i < 600; i++ {
if err := syscall.Kill(conf.Pid, syscall.SIGHUP); err != nil {
os.Setenv("_FUSE_STATE_PATH", conf.StatePath)
os.Setenv("_JFS_META_SID", strconv.Itoa(int(conf.Meta.Sid)))
return
}
time.Sleep(time.Millisecond * 100)
Expand Down Expand Up @@ -505,11 +506,7 @@ func canShutdownGracefully(mp string, newConf *vfs.Config) bool {
}
if oldConf.FuseOpts.DisableXAttrs && !newConf.FuseOpts.DisableXAttrs {
logger.Infof("Xattr is enabled, mount on top of it")
}
// pass the session id to the new process, sid=0 means old process is read-only mode
if oldConf.Meta.Sid != 0 {
logger.Infof("pass the old session id %d to the new process", oldConf.Meta.Sid)
os.Setenv("_JFS_META_SID", strconv.FormatUint(oldConf.Meta.Sid, 10))
return false
}
return true
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/passfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func handleFDRequest(conn *net.UnixConn) {
var fds = []int{0}
if fuseFd > 0 {
fds = append(fds, fuseFd)
} else {
logger.Warnf("no FUSE fd available")
}
err := putFd(conn, fuseSetting, fds...)
if err != nil {
Expand Down

0 comments on commit 849ccc3

Please sign in to comment.