Skip to content

Commit a6fb0d6

Browse files
foxengwkozaczuk
authored andcommitted
virtio-fs: fix allocation failure condition
Signed-off-by: Fotis Xenakis <[email protected]> Message-Id: <AM0PR03MB62923313E325B75908C1C3ADA67A0@AM0PR03MB6292.eurprd03.prod.outlook.com>
1 parent ccef5ca commit a6fb0d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/virtiofs/virtiofs_vnops.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static int virtiofs_lookup(struct vnode* vnode, char* name, struct vnode** vpp)
4444
}
4545

4646
if (!S_ISDIR(inode->attr.mode)) {
47-
kprintf("[virtiofs] inode:%lld, ABORTED lookup of %s because not a "
47+
kprintf("[virtiofs] inode %lld, ABORTED lookup of %s because not a "
4848
"directory\n", inode->nodeid, name);
4949
return ENOTDIR;
5050
}
@@ -64,7 +64,7 @@ static int virtiofs_lookup(struct vnode* vnode, char* name, struct vnode** vpp)
6464
inode->nodeid, in_args.get(), in_args_len, out_args.get(),
6565
sizeof(*out_args));
6666
if (error) {
67-
kprintf("[virtiofs] inode:%lld, lookup failed to find %s\n",
67+
kprintf("[virtiofs] inode %lld, lookup failed to find %s\n",
6868
inode->nodeid, name);
6969
// TODO: Implement proper error handling by sending FUSE_FORGET
7070
return error;
@@ -73,7 +73,7 @@ static int virtiofs_lookup(struct vnode* vnode, char* name, struct vnode** vpp)
7373
struct vnode* vp;
7474
// TODO OPT: Should we even use the cache? (consult spec on metadata)
7575
if (vget(vnode->v_mount, out_args->nodeid, &vp) == 1) {
76-
virtiofs_debug("lookup found vp in cache!\n");
76+
virtiofs_debug("lookup found vp in cache\n");
7777
*vpp = vp;
7878
return 0;
7979
}
@@ -83,7 +83,7 @@ static int virtiofs_lookup(struct vnode* vnode, char* name, struct vnode** vpp)
8383
return ENOMEM;
8484
}
8585
new_inode->nodeid = out_args->nodeid;
86-
virtiofs_debug("inode %lld, lookup found inode %lld for %s!\n",
86+
virtiofs_debug("inode %lld, lookup found inode %lld for %s\n",
8787
inode->nodeid, new_inode->nodeid, name);
8888
memcpy(&new_inode->attr, &out_args->attr, sizeof(out_args->attr));
8989

@@ -196,7 +196,7 @@ static int virtiofs_read_fallback(virtiofs_inode& inode, u64 file_handle,
196196
std::unique_ptr<void, std::function<void(void*)>> buf {
197197
memory::alloc_phys_contiguous_aligned(read_amt,
198198
alignof(std::max_align_t)), memory::free_phys_contiguous_aligned };
199-
if (!in_args | !buf) {
199+
if (!in_args || !buf) {
200200
return ENOMEM;
201201
}
202202
in_args->fh = file_handle;

0 commit comments

Comments
 (0)