diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-24 12:57:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-24 12:57:10 -0400 |
commit | d7ed9c05ebf56c04811276207d7110706debe09f (patch) | |
tree | 8248800681e1dc4ea0385ea6f821387f2d56baa7 /fs/udf/lowlevel.c | |
parent | 4d8d4d251df8eaaa3dae71c8cfa7fbf4510d967d (diff) | |
parent | 3391faa4f18e4e33666d3d24e90e3086fcf9b922 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
udf: remove redundant tests on unsigned
udf: Use device size when drive reported bogus number of written blocks
Diffstat (limited to 'fs/udf/lowlevel.c')
-rw-r--r-- | fs/udf/lowlevel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c index 703843f30ffd..1b88fd5df05d 100644 --- a/fs/udf/lowlevel.c +++ b/fs/udf/lowlevel.c | |||
@@ -56,7 +56,12 @@ unsigned long udf_get_last_block(struct super_block *sb) | |||
56 | struct block_device *bdev = sb->s_bdev; | 56 | struct block_device *bdev = sb->s_bdev; |
57 | unsigned long lblock = 0; | 57 | unsigned long lblock = 0; |
58 | 58 | ||
59 | if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock)) | 59 | /* |
60 | * ioctl failed or returned obviously bogus value? | ||
61 | * Try using the device size... | ||
62 | */ | ||
63 | if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock) || | ||
64 | lblock == 0) | ||
60 | lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits; | 65 | lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits; |
61 | 66 | ||
62 | if (lblock) | 67 | if (lblock) |