Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 694
b: refs/heads/master
c: 2c49be9
h: refs/heads/master
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed May 1, 2005
1 parent f82abc9 commit 85dbe58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acef2e55d2a1b59bb5610cacc546c1d1b5de2dc9
refs/heads/master: 2c49be99ede1e3685a9817a564b4b1678d48e1b9
14 changes: 10 additions & 4 deletions trunk/arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static struct gendisk *fake_gendisk[MAX_DEV];
static struct openflags global_openflags = OPEN_FLAGS;

struct cow {
/* This is the backing file, actually */
char *file;
int fd;
unsigned long *bitmap;
Expand Down Expand Up @@ -927,10 +928,14 @@ static int ubd_open(struct inode *inode, struct file *filp)
}
}
dev->count++;
if((filp->f_mode & FMODE_WRITE) && !dev->openflags.w){
set_disk_ro(disk, !dev->openflags.w);

/* This should no more be needed. And it didn't work anyway to exclude
* read-write remounting of filesystems.*/
/*if((filp->f_mode & FMODE_WRITE) && !dev->openflags.w){
if(--dev->count == 0) ubd_close(dev);
err = -EROFS;
}
}*/
out:
return(err);
}
Expand Down Expand Up @@ -1096,6 +1101,7 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)

if(req->rq_status == RQ_INACTIVE) return(1);

/* This should be impossible now */
if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
printk("Write attempted on readonly ubd device %s\n",
disk->disk_name);
Expand Down Expand Up @@ -1243,6 +1249,7 @@ static int ubd_check_remapped(int fd, unsigned long address, int is_write,

/* It's a write to a ubd device */

/* This should be impossible now */
if(!dev->openflags.w){
/* It's a write access on a read-only device - probably
* shouldn't happen. If the kernel is trying to change
Expand Down Expand Up @@ -1605,8 +1612,7 @@ void do_io(struct io_thread_req *req)
}
} while((n < len) && (n != 0));
if (n < len) memset(&buf[n], 0, len - n);
}
else {
} else {
n = os_write_file(req->fds[bit], buf, len);
if(n != len){
printk("do_io - write failed err = %d "
Expand Down

0 comments on commit 85dbe58

Please sign in to comment.