Commit 2ac66408 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: set Mode to S_IFDIR automatically in Mkdir

parent 815ee9aa
...@@ -303,6 +303,10 @@ func (b *rawBridge) Mkdir(cancel <-chan struct{}, input *fuse.MkdirIn, name stri ...@@ -303,6 +303,10 @@ func (b *rawBridge) Mkdir(cancel <-chan struct{}, input *fuse.MkdirIn, name stri
return errnoToStatus(errno) return errnoToStatus(errno)
} }
if out.Attr.Mode&^07777 == 0 {
out.Attr.Mode |= fuse.S_IFDIR
}
if out.Attr.Mode&^07777 != fuse.S_IFDIR { if out.Attr.Mode&^07777 != fuse.S_IFDIR {
log.Panicf("Mkdir: mode must be S_IFDIR (%o), got %o", fuse.S_IFDIR, out.Attr.Mode) log.Panicf("Mkdir: mode must be S_IFDIR (%o), got %o", fuse.S_IFDIR, out.Attr.Mode)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment