diff options
Diffstat (limited to 'fs/block_dev.c')
| -rw-r--r-- | fs/block_dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 1e86823a9cbd..ba0d2b05bb78 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -83,7 +83,7 @@ void kill_bdev(struct block_device *bdev) | |||
| 83 | { | 83 | { |
| 84 | struct address_space *mapping = bdev->bd_inode->i_mapping; | 84 | struct address_space *mapping = bdev->bd_inode->i_mapping; |
| 85 | 85 | ||
| 86 | if (mapping->nrpages == 0) | 86 | if (mapping->nrpages == 0 && mapping->nrshadows == 0) |
| 87 | return; | 87 | return; |
| 88 | 88 | ||
| 89 | invalidate_bh_lrus(); | 89 | invalidate_bh_lrus(); |
| @@ -419,7 +419,7 @@ static void bdev_evict_inode(struct inode *inode) | |||
| 419 | { | 419 | { |
| 420 | struct block_device *bdev = &BDEV_I(inode)->bdev; | 420 | struct block_device *bdev = &BDEV_I(inode)->bdev; |
| 421 | struct list_head *p; | 421 | struct list_head *p; |
| 422 | truncate_inode_pages(&inode->i_data, 0); | 422 | truncate_inode_pages_final(&inode->i_data); |
| 423 | invalidate_inode_buffers(inode); /* is it needed here? */ | 423 | invalidate_inode_buffers(inode); /* is it needed here? */ |
| 424 | clear_inode(inode); | 424 | clear_inode(inode); |
| 425 | spin_lock(&bdev_lock); | 425 | spin_lock(&bdev_lock); |
| @@ -1523,7 +1523,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
| 1523 | ssize_t err; | 1523 | ssize_t err; |
| 1524 | 1524 | ||
| 1525 | err = generic_write_sync(file, pos, ret); | 1525 | err = generic_write_sync(file, pos, ret); |
| 1526 | if (err < 0 && ret > 0) | 1526 | if (err < 0) |
| 1527 | ret = err; | 1527 | ret = err; |
| 1528 | } | 1528 | } |
| 1529 | blk_finish_plug(&plug); | 1529 | blk_finish_plug(&plug); |
