Skip to content

Commit 402e7c5

Browse files
zyfjeffjiangliu
authored andcommitted
Optimize log output and print in vfs umount scenario
1. optimize the log of forget, for scenarios where forget cannot handle when the vfs submount is dropped by umount. 2. remove the error log printed when write fuse fails, and hand it to the caller to process and print. Signed-off-by: zyfjeff <zyfjeff@linux.alibaba.com>
1 parent d2ec9cb commit 402e7c5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/api/vfs/sync_io.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,15 @@ impl FileSystem for Vfs {
9191
(Right(fs), idata) => fs.forget(ctx, idata.ino(), count),
9292
},
9393
Err(e) => {
94-
error!("vfs::forget: failed to get_real_rootfs {:?}", e);
94+
// When a directory is umount and invalidate entry, a forget request is triggered,
95+
// which cannot be forwarded to the backend file system.
96+
// this situation is reasonable, so it is changed to warn here
97+
warn!(
98+
"vfs::forget: failed to get_real_rootfs {:?}, inode: {:?},
99+
maybe it is possible that the vfs submount was dropped by umount,
100+
which is reasonable.",
101+
e, inode
102+
);
95103
}
96104
}
97105
}

src/transport/fusedev/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ impl<'a, S: BitmapSlice> FuseDevWriter<'a, S> {
157157
}
158158
};
159159

160-
res.map_err(|e| {
161-
error! {"fail to write to fuse device on commit: {}", e};
162-
io::Error::from_raw_os_error(e as i32)
163-
})
160+
res.map_err(|e| io::Error::from_raw_os_error(e as i32))
164161
}
165162

166163
/// Return number of bytes already written to the internal buffer.

0 commit comments

Comments
 (0)