Skip to content

Commit

Permalink
UBIFS: use PAGE_CACHE_MASK correctly
Browse files Browse the repository at this point in the history
It has high bits set, not low bits set as the UBIFS code
assumed.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Dec 23, 2008
1 parent 995be04 commit 7bbe5b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ubifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static int write_begin_slow(struct address_space *mapping,
}

if (!PageUptodate(page)) {
if (!(pos & PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE)
if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE)
SetPageChecked(page);
else {
err = do_readpage(page);
Expand Down Expand Up @@ -444,7 +444,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,

if (!PageUptodate(page)) {
/* The page is not loaded from the flash */
if (!(pos & PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE)
if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE)
/*
* We change whole page so no need to load it. But we
* have to set the @PG_checked flag to make the further
Expand Down

0 comments on commit 7bbe5b5

Please sign in to comment.