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

blobfs: ensure blob cache dir exist #358

Merged
merged 1 commit into from
Mar 30, 2022
Merged

Conversation

MercyMM
Copy link

@MercyMM MercyMM commented Mar 29, 2022

When blob_cache_dir does not exist, create it instead of return error.

Signed-off-by: gexuyang gexuyang@linux.alibaba.com

@MercyMM MercyMM changed the title blobfs: ensure blob cahche dir exist blobfs: ensure blob cache dir exist Mar 29, 2022
@jiangliu
Copy link
Collaborator

Please help to add commit message:)

@MercyMM
Copy link
Author

MercyMM commented Mar 29, 2022

done

if !path.exists() {
create_dir_all(path).map_err(|e| {
error!("create dir error: {:?}", path);
e
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use use macro einval!(e) which shows more verbose message including file!() and line!()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macro einval! is more convenient, but it will lose real error code return from create_dir_all().

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with it, but we need to make error!("create dir error: {:?}", path); more verbose so that we know where goes wrong exactly.

When blob_cache_dir does not exist, create it instead of return error.

Signed-off-by: gexuyang <gexuyang@linux.alibaba.com>
@liubogithub liubogithub merged commit 5c0d572 into dragonflyoss:master Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants