Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329007
b: refs/heads/master
c: 78f7d75
h: refs/heads/master
i:
  329005: 8c0e2e0
  329003: 2c4e7f4
  328999: 1a0ac2f
  328991: 6a25c88
v: v3
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 41dea18 commit 0023f2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 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: 88b428d6e191affae79b5c1f4764dfdebab9fae6
refs/heads/master: 78f7d75e5dd9aa1027e90d0b71d394603933c2ed
32 changes: 15 additions & 17 deletions trunk/fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,41 +109,39 @@ static int get_device_index(struct coda_mount_data *data)
{
struct file *file;
struct inode *inode;
int idx;
int idx, fput_needed;

if(data == NULL) {
if (data == NULL) {
printk("coda_read_super: Bad mount data\n");
return -1;
}

if(data->version != CODA_MOUNT_VERSION) {
if (data->version != CODA_MOUNT_VERSION) {
printk("coda_read_super: Bad mount version\n");
return -1;
}

file = fget(data->fd);
inode = NULL;
if(file)
inode = file->f_path.dentry->d_inode;

if(!inode || !S_ISCHR(inode->i_mode) ||
imajor(inode) != CODA_PSDEV_MAJOR) {
if(file)
fput(file);

printk("coda_read_super: Bad file\n");
return -1;
file = fget_light(data->fd, &fput_needed);
if (!file)
goto Ebadf;
inode = file->f_path.dentry->d_inode;
if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) {
fput_light(file, fput_needed);
goto Ebadf;
}

idx = iminor(inode);
fput(file);
fput_light(file, fput_needed);

if(idx < 0 || idx >= MAX_CODADEVS) {
if (idx < 0 || idx >= MAX_CODADEVS) {
printk("coda_read_super: Bad minor number\n");
return -1;
}

return idx;
Ebadf:
printk("coda_read_super: Bad file\n");
return -1;
}

static int coda_fill_super(struct super_block *sb, void *data, int silent)
Expand Down

0 comments on commit 0023f2c

Please sign in to comment.