VFS fixes:
- do not use uninitialized req_breadwrite results upon failure - improve ".." ELEAVEMOUNT correctness check
This commit is contained in:
parent
91655261a1
commit
27d53256e4
@ -262,7 +262,8 @@ node_details_t *node;
|
|||||||
* to the parent FS. That is, when we climb up the tree, we
|
* to the parent FS. That is, when we climb up the tree, we
|
||||||
* must've encountered ".." in the path, and that is exactly
|
* must've encountered ".." in the path, and that is exactly
|
||||||
* what we're going to feed to the parent */
|
* what we're going to feed to the parent */
|
||||||
if(strncmp(user_fullpath, "..", 2) != 0) {
|
if(strncmp(user_fullpath, "..", 2) != 0 ||
|
||||||
|
(user_fullpath[2] != '\0' && user_fullpath[2] != '/')) {
|
||||||
printf("VFS: bogus path: %s\n", user_fullpath);
|
printf("VFS: bogus path: %s\n", user_fullpath);
|
||||||
return(ENOENT);
|
return(ENOENT);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,8 +105,10 @@ int rw_flag; /* READING or WRITING */
|
|||||||
} else if (block_spec) { /* Block special files. */
|
} else if (block_spec) { /* Block special files. */
|
||||||
r = req_breadwrite(vp->v_bfs_e, who_e, vp->v_sdev, position,
|
r = req_breadwrite(vp->v_bfs_e, who_e, vp->v_sdev, position,
|
||||||
m_in.nbytes, m_in.buffer, rw_flag, &res_pos, &res_cum_io);
|
m_in.nbytes, m_in.buffer, rw_flag, &res_pos, &res_cum_io);
|
||||||
position = res_pos;
|
if (r == OK) {
|
||||||
cum_io += res_cum_io;
|
position = res_pos;
|
||||||
|
cum_io += res_cum_io;
|
||||||
|
}
|
||||||
} else { /* Regular files */
|
} else { /* Regular files */
|
||||||
if (rw_flag == WRITING && block_spec == 0) {
|
if (rw_flag == WRITING && block_spec == 0) {
|
||||||
/* Check for O_APPEND flag. */
|
/* Check for O_APPEND flag. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user