]> git.baikalelectronics.ru Git - kernel.git/commit
exofs: Fix __r4w_get_page when offset is beyond i_size
authorBoaz Harrosh <bharrosh@panasas.com>
Fri, 20 Jul 2012 12:50:27 +0000 (15:50 +0300)
committerBoaz Harrosh <bharrosh@panasas.com>
Thu, 2 Aug 2012 11:58:22 +0000 (14:58 +0300)
commit72e2a85c443f90e51ab59cbc8c4a9d4de21d727b
treec0fec691c12f1efa3f8fa74d1b113a88b98d15c7
parentb2822ed10429c37a59c0f1c409c28366dae697bb
exofs: Fix __r4w_get_page when offset is beyond i_size

It is very common for the end of the file to be unaligned on
stripe size. But since we know it's beyond file's end then
the XOR should be preformed with all zeros.

Old code used to just read zeros out of the OSD devices, which is a great
waist. But what scares me more about this situation is that, we now have
pages attached to the file's mapping that are beyond i_size. I don't
like the kind of bugs this calls for.

Fix both birds, by returning a global ZERO_PAGE, if offset is beyond
i_size.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
fs/exofs/inode.c