Commit 9d5f7e99 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parents 8e7f68ca 1d6f9351
......@@ -303,6 +303,10 @@ func (b *rawBridge) Mkdir(cancel <-chan struct{}, input *fuse.MkdirIn, name stri
return errnoToStatus(errno)
}
if out.Attr.Mode&^07777 == 0 {
out.Attr.Mode |= 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)
}
......@@ -443,7 +447,9 @@ func (b *rawBridge) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName
if input.Flags&RENAME_EXCHANGE != 0 {
p1.ExchangeChild(oldName, p2, newName)
} else {
p1.MvChild(oldName, p2, newName, true)
if ok := p1.MvChild(oldName, p2, newName, true); !ok {
log.Println("MvChild failed")
}
}
return errnoToStatus(errno)
......
......@@ -164,10 +164,10 @@ func (n *Inode) String() string {
defer n.mu.Unlock()
var ss []string
for nm, ch := range n.children {
ss = append(ss, fmt.Sprintf("%q=%d[%s]", nm, ch.stableAttr.Ino, modeStr(ch.stableAttr.Mode)))
ss = append(ss, fmt.Sprintf("%q=i%d[%s]", nm, ch.stableAttr.Ino, modeStr(ch.stableAttr.Mode)))
}
return fmt.Sprintf("%d[%s]: %s", n.stableAttr.Ino, modeStr(n.stableAttr.Mode), strings.Join(ss, ","))
return fmt.Sprintf("i%d (%s): %s", n.stableAttr.Ino, modeStr(n.stableAttr.Mode), strings.Join(ss, ","))
}
// sortNodes rearranges inode group in consistent order.
......
......@@ -157,7 +157,7 @@ type MountOptions struct {
// If set, ask kernel not to do automatic data cache invalidation.
// The filesystem is fully responsible for invalidating data cache.
PreciseDataCacheControl bool
ExplicitDataCacheControl bool
}
// RawFileSystem is an interface close to the FUSE wire protocol.
......
......@@ -102,13 +102,13 @@ func doInit(server *Server, req *request) {
dataCacheMode := input.Flags & CAP_AUTO_INVAL_DATA
if server.opts.PreciseDataCacheControl {
// we don't want CAP_AUTO_INVAL_DATA even if we cannot go into fully precise mode
if server.opts.ExplicitDataCacheControl {
// we don't want CAP_AUTO_INVAL_DATA even if we cannot go into fully explicit mode
dataCacheMode = 0
precise := input.Flags & CAP_PRECISE_INVAL_DATA
if precise != 0 {
dataCacheMode = precise
explicit := input.Flags & CAP_EXPLICIT_INVAL_DATA
if explicit != 0 {
dataCacheMode = explicit
}
}
server.kernelSettings.Flags |= dataCacheMode
......
......@@ -47,7 +47,7 @@ var (
CAP_MAX_PAGES: "MAX_PAGES",
CAP_CACHE_SYMLINKS: "CACHE_SYMLINKS",
CAP_NO_OPENDIR_SUPPORT: "NO_OPENDIR_SUPPORT",
CAP_PRECISE_INVAL_DATA: "PRECISE_INVAL_DATA",
CAP_EXPLICIT_INVAL_DATA: "EXPLICIT_INVAL_DATA",
}
releaseFlagNames = map[int64]string{
RELEASE_FLUSH: "FLUSH",
......
......@@ -48,7 +48,7 @@ func setupCacheTest(t *testing.T) (string, *pathfs.PathNodeFs, func()) {
mntOpts := &fuse.MountOptions{
// ask kernel not to invalidate file data automatically
PreciseDataCacheControl: true,
ExplicitDataCacheControl: true,
Debug: testutil.VerboseTest(),
}
......
......@@ -290,7 +290,7 @@ const (
CAP_MAX_PAGES = (1 << 22)
CAP_CACHE_SYMLINKS = (1 << 23)
CAP_NO_OPENDIR_SUPPORT = (1 << 24)
CAP_PRECISE_INVAL_DATA = (1 << 25)
CAP_EXPLICIT_INVAL_DATA = (1 << 25)
)
type InitIn struct {
......
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