public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] minix: fix add link - wrong position calculation
@ 2008-12-28 23:25 Evgeniy Dushistov
  2008-12-30 23:32 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Evgeniy Dushistov @ 2008-12-28 23:25 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Andrew Morton, linux-kernel

This patch fixes add link method.
Position in directory was calculated in wrong way.

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
---
 fs/minix/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index f704338..4b603b7 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -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)
-- 
1.6.0.6

-- 
/Evgeniy


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] minix: fix add link - wrong position calculation
  2008-12-28 23:25 [PATCH] minix: fix add link - wrong position calculation Evgeniy Dushistov
@ 2008-12-30 23:32 ` Andrew Morton
  2008-12-31  1:26   ` Nick Piggin
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2008-12-30 23:32 UTC (permalink / raw)
  To: Evgeniy Dushistov; +Cc: npiggin, linux-kernel

On Mon, 29 Dec 2008 02:25:50 +0300
Evgeniy Dushistov <dushistov@mail.ru> wrote:

> This patch fixes add link method.
> Position in directory was calculated in wrong way.
> 
> Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
> ---
>  fs/minix/dir.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/minix/dir.c b/fs/minix/dir.c
> index f704338..4b603b7 100644
> --- a/fs/minix/dir.c
> +++ b/fs/minix/dir.c
> @@ -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)

Well that's cute.  Seems that we broke it over a year ago:

commit 4a66af9eaa9531372cfcb9e20103ed147c729ff9
Author:     Nick Piggin <npiggin@suse.de>
AuthorDate: Tue Oct 16 01:25:21 2007 -0700
Commit:     Linus Torvalds <torvalds@woody.linux-foundation.org>
CommitDate: Tue Oct 16 09:42:57 2007 -0700

    minixfs: convert to new aops

Is minixfs getting THAT little use, or is this bustage more subtle
than it appears?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] minix: fix add link - wrong position calculation
  2008-12-30 23:32 ` Andrew Morton
@ 2008-12-31  1:26   ` Nick Piggin
  2008-12-31  1:49     ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Piggin @ 2008-12-31  1:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Evgeniy Dushistov, linux-kernel

On Tue, Dec 30, 2008 at 03:32:30PM -0800, Andrew Morton wrote:
> On Mon, 29 Dec 2008 02:25:50 +0300
> Evgeniy Dushistov <dushistov@mail.ru> wrote:
> 
> > This patch fixes add link method.
> > Position in directory was calculated in wrong way.
> > 
> > Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
> > ---
> >  fs/minix/dir.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/fs/minix/dir.c b/fs/minix/dir.c
> > index f704338..4b603b7 100644
> > --- a/fs/minix/dir.c
> > +++ b/fs/minix/dir.c
> > @@ -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)
> 
> Well that's cute.  Seems that we broke it over a year ago:
> 
> commit 4a66af9eaa9531372cfcb9e20103ed147c729ff9
> Author:     Nick Piggin <npiggin@suse.de>
> AuthorDate: Tue Oct 16 01:25:21 2007 -0700
> Commit:     Linus Torvalds <torvalds@woody.linux-foundation.org>
> CommitDate: Tue Oct 16 09:42:57 2007 -0700
> 
>     minixfs: convert to new aops
> 
> Is minixfs getting THAT little use, or is this bustage more subtle
> than it appears?

Not getting used, I'd suspect (although I definitely have used it -- I
converted it to large block size for testing fsblock, probably I didn't
test softlinks).

But anyway I think it is still useful as a primer for ext2? Probably there
are quite a lot of other filesystems that are less useful than minix ;)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] minix: fix add link - wrong position calculation
  2008-12-31  1:26   ` Nick Piggin
@ 2008-12-31  1:49     ` Al Viro
  0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2008-12-31  1:49 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Andrew Morton, Evgeniy Dushistov, linux-kernel

On Wed, Dec 31, 2008 at 02:26:41AM +0100, Nick Piggin wrote:
> > commit 4a66af9eaa9531372cfcb9e20103ed147c729ff9
> > Author:     Nick Piggin <npiggin@suse.de>
> > AuthorDate: Tue Oct 16 01:25:21 2007 -0700
> > Commit:     Linus Torvalds <torvalds@woody.linux-foundation.org>
> > CommitDate: Tue Oct 16 09:42:57 2007 -0700
> > 
> >     minixfs: convert to new aops
> > 
> > Is minixfs getting THAT little use, or is this bustage more subtle
> > than it appears?
> 
> Not getting used, I'd suspect (although I definitely have used it -- I
> converted it to large block size for testing fsblock, probably I didn't
> test softlinks).

Much simpler: there's one index for which the expressions are equivalent ;-)
Count how many entries does it take on minixfs to get to 4Kb.  Now think
how many had used that sucker on directories with >= 128 entries...


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-31  1:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-28 23:25 [PATCH] minix: fix add link - wrong position calculation Evgeniy Dushistov
2008-12-30 23:32 ` Andrew Morton
2008-12-31  1:26   ` Nick Piggin
2008-12-31  1:49     ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox