Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376494
b: refs/heads/master
c: 31abdab
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed May 31, 2013
1 parent a367060 commit ec52468
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 1d7095c72d35eee4ebc28e66563e636b9adafeb2
refs/heads/master: 31abdab9c11bb1694ecd1476a7edbe8e964d94ac
10 changes: 6 additions & 4 deletions trunk/fs/hpfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,27 @@ static loff_t hpfs_dir_lseek(struct file *filp, loff_t off, int whence)
if (whence == SEEK_DATA || whence == SEEK_HOLE)
return -EINVAL;

mutex_lock(&i->i_mutex);
hpfs_lock(s);

/*printk("dir lseek\n");*/
if (new_off == 0 || new_off == 1 || new_off == 11 || new_off == 12 || new_off == 13) goto ok;
mutex_lock(&i->i_mutex);
pos = ((loff_t) hpfs_de_as_down_as_possible(s, hpfs_inode->i_dno) << 4) + 1;
while (pos != new_off) {
if (map_pos_dirent(i, &pos, &qbh)) hpfs_brelse4(&qbh);
else goto fail;
if (pos == 12) goto fail;
}
mutex_unlock(&i->i_mutex);
hpfs_add_pos(i, &filp->f_pos);
ok:
filp->f_pos = new_off;
hpfs_unlock(s);
return filp->f_pos = new_off;
fail:
mutex_unlock(&i->i_mutex);
return new_off;
fail:
/*printk("illegal lseek: %016llx\n", new_off);*/
hpfs_unlock(s);
mutex_unlock(&i->i_mutex);
return -ESPIPE;
}

Expand Down

0 comments on commit ec52468

Please sign in to comment.