Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212770
b: refs/heads/master
c: a33f13e
h: refs/heads/master
v: v3
  • Loading branch information
Joel Becker committed Sep 10, 2010
1 parent ae9d566 commit 36e3f79
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 3bdb8efd94a73bb137e3315cd831cbc874052b4b
refs/heads/master: a33f13efe05192e7a805018a2ce2b2afddd04057
8 changes: 4 additions & 4 deletions trunk/fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,17 +925,17 @@ EXPORT_SYMBOL(generic_file_fsync);
int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks)
{
u64 last_fs_block = num_blocks - 1;
u64 last_fs_page =
last_fs_block >> (PAGE_CACHE_SHIFT - blocksize_bits);

if (unlikely(num_blocks == 0))
return 0;

if ((blocksize_bits < 9) || (blocksize_bits > PAGE_CACHE_SHIFT))
return -EINVAL;

if ((last_fs_block >
(sector_t)(~0ULL) >> (blocksize_bits - 9)) ||
(last_fs_block >
(pgoff_t)(~0ULL) >> (PAGE_CACHE_SHIFT - blocksize_bits))) {
if ((last_fs_block > (sector_t)(~0ULL) >> (blocksize_bits - 9)) ||
(last_fs_page > (pgoff_t)(~0ULL))) {
return -EFBIG;
}
return 0;
Expand Down

0 comments on commit 36e3f79

Please sign in to comment.