]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UBIFS: use PAGE_CACHE_MASK correctly
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 9 Dec 2008 16:02:51 +0000 (11:02 -0500)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 23 Dec 2008 10:19:14 +0000 (12:19 +0200)
It has high bits set, not low bits set as the UBIFS code
assumed.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
fs/ubifs/file.c

index 2624411d9758d11023c938418f8a6a7938066ff5..7f1de98e609104ed55a21e86c72e7116918ab906 100644 (file)
@@ -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);
@@ -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