]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
minix: fix add link's wrong position calculation
authorEvgeniy Dushistov <dushistov@mail.ru>
Tue, 6 Jan 2009 22:42:38 +0000 (14:42 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 18 Jan 2009 18:43:47 +0000 (10:43 -0800)
commit d6b54841f4ddd836c886d1e6ac381cf309ee98a3 upstream.

Fix the add link method.  The oosition in the directory was calculated in
wrong way - it had the incorrect shift direction.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/minix/dir.c

index f70433816a3806ab6846b75dec1ee418fcd75f2c..d4946c4c90e2f2b989f410fc3b69552a382303f4 100644 (file)
@@ -280,7 +280,7 @@ int minix_add_link(struct dentry *dentry, struct inode *inode)
        return -EINVAL;
 
 got_it:
-       pos = (page->index >> PAGE_CACHE_SHIFT) + p - (char*)page_address(page);
+       pos = page_offset(page) + p - (char *)page_address(page);
        err = __minix_write_begin(NULL, page->mapping, pos, sbi->s_dirsize,
                                        AOP_FLAG_UNINTERRUPTIBLE, &page, NULL);
        if (err)