mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 12:56:48 +00:00
Fix panic when mount with invalid file system type
This commit is contained in:
parent
55deb6a68b
commit
01328ee404
@ -164,7 +164,9 @@ fn get_fs(
|
|||||||
let data = user_space.read_cstring(data, MAX_FILENAME_LEN)?;
|
let data = user_space.read_cstring(data, MAX_FILENAME_LEN)?;
|
||||||
let data = data.to_string_lossy();
|
let data = data.to_string_lossy();
|
||||||
|
|
||||||
let fs_type = fs_type.to_str().unwrap();
|
let fs_type = fs_type
|
||||||
|
.to_str()
|
||||||
|
.map_err(|_| Error::with_message(Errno::ENODEV, "Invalid file system type"))?;
|
||||||
match fs_type {
|
match fs_type {
|
||||||
"ext2" => {
|
"ext2" => {
|
||||||
let device = aster_block::get_device(devname.to_str().unwrap()).ok_or(
|
let device = aster_block::get_device(devname.to_str().unwrap()).ok_or(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user