All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <juhl-lkml@dif.dk>
To: Mike Fedyk <mfedyk@matchmail.com>
Cc: Hans Reiser <reiser@namesys.com>,
	"Tigran A. Aivazian" <tigran@veritas.com>,
	Hans Reiser <reiserfs-dev@namesys.com>,
	Daniel Pirkl <daniel.pirkl@email.cz>,
	Russell King <rmk@arm.linux.org.uk>,
	Will Dyson <will_dyson@pobox.com>,
	linux-kernel@vger.kernel.org, nikita@namesys.com
Subject: Re: Suspected bug infilesystems (UFS,ADFS,BEFS,BFS,ReiserFS) related to sector_t being unsigned, advice requested
Date: Tue, 6 Jan 2004 23:43:40 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.56.0401062251290.8384@jju_lnx.backbone.dif.dk> (raw)
In-Reply-To: <20040106174650.GD1882@matchmail.com>


On Tue, 6 Jan 2004, Mike Fedyk wrote:

> On Tue, Jan 06, 2004 at 12:28:34PM +0100, Jesper Juhl wrote:
> > --- linux-2.6.1-rc1-mm2-orig/fs/reiserfs/inode.c        2004-01-06 01:33:08.000000000 +0100
> > +++ linux-2.6.1-rc1-mm2/fs/reiserfs/inode.c     2004-01-06 12:16:16.000000000 +0100
> > @@ -574,11 +574,6 @@ int reiserfs_get_block (struct inode * i
> >      th.t_trans_id = 0 ;
> >      version = get_inode_item_key_version (inode);
> >
> > -    if (block < 0) {
> > -       reiserfs_write_unlock(inode->i_sb);
> > -       return -EIO;
> > -    }
> > -
>
> Did you check the locking after this is removed?
>

reiserfs_write_unlock(inode->i_sb); is called at the beginning of the
function, and as far as I can tell it's matched by a call to
reiserfs_write_unlock(inode->i_sb); at every potential return point in the
function, and I see no other locks being taken.
Besides, since  if (block < 0)  will never be true and
	reiserfs_write_unlock(inode->i_sb);
	return -EIO;
will never execute in any case, locking should behave identical to what it
did before removing the code.
Locking /seems/ OK to me in this function.

Also, I did a build of fs/reiserfs/ both with and without the above patch,
and then did a disassemble of inode.o (objdump -d) and compared the
generated code for reiserfs_get_block , and the generated code is
byte-for-byte identical in both cases, which means that gcc realizes that
the if() statement will never execute and optimizes it away in any case.

This is a further indication that removing the code should be safe.
And it seems to me that any code that assumes that a sector_t value can be
negative is either broken or obsolete.


> Maybe after the sector_t merges, this code covered a case that is left open
> now...
>

I'm not familliar with those "sector_t merges" you are refering to, but I
found some mention of a 64bit sector_t merge in the 2.5.x kernel
Changelogs, so I downloaded the 2.5.10 kernel source (first reference to
sector_t I found was in the 2.5.11 changelog) and took a look at how
sector_t used to be defined. It seems that it was an unsigned value even
back then.
Has sector_t ever been signed?


/Jesper Juhl


  parent reply	other threads:[~2004-01-06 22:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-05 23:20 Suspected bug infilesystems (UFS,ADFS,BEFS,BFS,ReiserFS) related to sector_t being unsigned, advice requested Jesper Juhl
2004-01-06  8:51 ` Hans Reiser
2004-01-06 11:28   ` Jesper Juhl
2004-01-06 17:46     ` Mike Fedyk
2004-01-06 21:35       ` Oleg Drokin
2004-01-06 22:25         ` Mike Fedyk
2004-01-06 23:37         ` Hans Reiser
2004-01-06 23:53           ` Oleg Drokin
2004-01-07  9:26             ` Hans Reiser
2004-01-07 10:01               ` Oleg Drokin
2004-01-07 11:00                 ` Hans Reiser
2004-01-07 12:08                   ` Oleg Drokin
2004-01-07 12:17                     ` Jesper Juhl
2004-01-07 12:27                       ` Oleg Drokin
2004-01-07 17:45                 ` Mike Fedyk
2004-01-13 16:26                 ` Adrian Bunk
2004-01-06 22:43       ` Jesper Juhl [this message]
2004-01-06 22:58         ` Mike Fedyk
2004-01-06 23:26         ` Hans Reiser
2004-01-07  0:46           ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.56.0401062251290.8384@jju_lnx.backbone.dif.dk \
    --to=juhl-lkml@dif.dk \
    --cc=daniel.pirkl@email.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfedyk@matchmail.com \
    --cc=nikita@namesys.com \
    --cc=reiser@namesys.com \
    --cc=reiserfs-dev@namesys.com \
    --cc=rmk@arm.linux.org.uk \
    --cc=tigran@veritas.com \
    --cc=will_dyson@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.