Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126235
b: refs/heads/master
c: 0f64415
h: refs/heads/master
i:
  126233: 448bb75
  126231: 70927c4
v: v3
  • Loading branch information
Dmitri Monakhov authored and Linus Torvalds committed Jan 6, 2009
1 parent e021a27 commit ac79112
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09f445e7f5107c91be12ed386350de6cd055e0a4
refs/heads/master: 0f64415d42760379753e6088787ce3fd3e069509
13 changes: 13 additions & 0 deletions trunk/fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,19 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
retval = direct_io_worker(rw, iocb, inode, iov, offset,
nr_segs, blkbits, get_block, end_io, dio);

/*
* In case of error extending write may have instantiated a few
* blocks outside i_size. Trim these off again for DIO_LOCKING.
* NOTE: DIO_NO_LOCK/DIO_OWN_LOCK callers have to handle this by
* it's own meaner.
*/
if (unlikely(retval < 0 && (rw & WRITE))) {
loff_t isize = i_size_read(inode);

if (end > isize && dio_lock_type == DIO_LOCKING)
vmtruncate(inode, isize);
}

if (rw == READ && dio_lock_type == DIO_LOCKING)
release_i_mutex = 0;

Expand Down

0 comments on commit ac79112

Please sign in to comment.