linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Cc: wkj@eecs.harvard.edu
Subject: [PATCH] isofs/rock.c
Date: Wed, 22 Nov 2000 02:02:40 +0100 (MET)	[thread overview]
Message-ID: <UTC200011220102.CAA141029.aeb@aak.cwi.nl> (raw)

William K. Josephson <wkj@eecs.harvard.edu>
wrote on Sun, 8 Oct 2000:

> While writing some user-space code recently, I ran across two bugs
> in the Rock Ridge support code.  First, a bogus return value and
> second links on the cd of the form foo->/bar are returned
> as foo->//bar.  This should fix it.

I think he was mistaken on both counts.
The present 2.4.0test11 only contains the first of his patches.
The 1-line patch below undoes that (and reintroduces some ugliness).

--- rock.c~     Tue Nov 21 21:44:14 2000
+++ rock.c      Wed Nov 22 00:55:33 2000
@@ -215,7 +215,7 @@
        printk("RR: RE (%x)\n", inode->i_ino);
 #endif
        if (buffer) kfree(buffer);
-       return 0;
+       return -1;
       default:
        break;
       }

[pasted from another window].

Concerning the case above: a RE entry denotes a relocated
directory, something we do not want to see here, so we
should return a "nothing" value.
The ugly code we used to have made get_rock_ridge_filename()
as called in dir.c return -1, and the code
		map = 1;
		if (we_have_rockridge) {
                        len = get_rock_ridge_filename(de, tmpname, inode);
                        if (len != 0) {
                                p = tmpname;
                                map = 0;
                        }
                }
                if (map) {
			...
		}
		if (len > 0) {
			...
		}
		filp->f_pos += de_len;
		continue;
	}
would make sure that nothing was done with this filename
and f_pos incremented, entirely as desired.
What 2.4.0test11 does is return 0, but now map is still 1,
and the code invents a real filename there, and then
comes with annoying console messages
	Attempt to read inode for relocated directory

So, the old situation was ugly but correct, the new situation wrong.

(I describe this in so much detail because I can readily imagine
that you would like to polish things a bit more.
This get_rock_ridge_filename is also called in namei.c, and
the -1 return value leads to obscure nonsense,
that happens to work today.)

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

                 reply	other threads:[~2000-11-22  1:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=UTC200011220102.CAA141029.aeb@aak.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=wkj@eecs.harvard.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).