VFS: fix access bits in device reopen calls
This commit is contained in:
parent
1939870c2e
commit
c4f3c7d66f
3 changed files with 3 additions and 4 deletions
|
@ -968,7 +968,7 @@ void bdev_up(int maj)
|
||||||
if (!S_ISBLK(vp->v_mode)) continue;
|
if (!S_ISBLK(vp->v_mode)) continue;
|
||||||
|
|
||||||
/* Reopen the device on the driver, once per filp. */
|
/* Reopen the device on the driver, once per filp. */
|
||||||
bits = mode_map[rfilp->filp_mode & O_ACCMODE];
|
bits = rfilp->filp_mode & (R_BIT|W_BIT);
|
||||||
if ((r = bdev_open(vp->v_sdev, bits)) != OK) {
|
if ((r = bdev_open(vp->v_sdev, bits)) != OK) {
|
||||||
printf("VFS: mounted dev %d/%d re-open failed: %d.\n",
|
printf("VFS: mounted dev %d/%d re-open failed: %d.\n",
|
||||||
maj, minor(vp->v_sdev), r);
|
maj, minor(vp->v_sdev), r);
|
||||||
|
@ -1124,7 +1124,7 @@ int maj;
|
||||||
if (rfilp->filp_flags & O_REOPEN) {
|
if (rfilp->filp_flags & O_REOPEN) {
|
||||||
/* Try to reopen a file upon driver restart */
|
/* Try to reopen a file upon driver restart */
|
||||||
r = dev_reopen(vp->v_sdev, rfilp-filp,
|
r = dev_reopen(vp->v_sdev, rfilp-filp,
|
||||||
vp->v_mode & (R_BIT|W_BIT));
|
rfilp->filp_mode & (R_BIT|W_BIT));
|
||||||
|
|
||||||
if (r == OK)
|
if (r == OK)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -51,7 +51,6 @@ EXTERN int err_code; /* temporary storage for error number */
|
||||||
/* Data initialized elsewhere. */
|
/* Data initialized elsewhere. */
|
||||||
extern int(*call_vec[]) (message *);
|
extern int(*call_vec[]) (message *);
|
||||||
extern int(*pfs_call_vec[]) (message *m_out);
|
extern int(*pfs_call_vec[]) (message *m_out);
|
||||||
extern char mode_map[]; /* mapping from O_ACCMODE mask to R_BIT/W_BIT flags */
|
|
||||||
|
|
||||||
EXTERN struct kinfo kinfo; /* kernel information */
|
EXTERN struct kinfo kinfo; /* kernel information */
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "vmnt.h"
|
#include "vmnt.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
|
||||||
char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
|
static char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
|
||||||
|
|
||||||
static struct vnode *new_node(struct lookup *resolve, int oflags,
|
static struct vnode *new_node(struct lookup *resolve, int oflags,
|
||||||
mode_t bits);
|
mode_t bits);
|
||||||
|
|
Loading…
Reference in a new issue