Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mount: fix upgrade with xattr #4450

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading