From: Christoph Hellwig <hch@ns.caldera.de>
To: mike@bangstate.com ("Michael L. Welles")
Cc: linux-kernel@vger.kernel.org
Subject: Re: kernel space getcwd()? (using current() to find out cwd)
Date: Tue, 17 Apr 2001 14:30:14 +0200 [thread overview]
Message-ID: <200104171230.OAA23346@ns.caldera.de> (raw)
In-Reply-To: <15067.30060.436790.458922@bangstate.com>
In article <15067.30060.436790.458922@bangstate.com> you wrote:
> So, a little ignorance being a dangerous thing, I thought I'd be clever
> and manually reconstruct the full path by walking up
> current->fs->pwd->d_parent and padding d_name to the filename until it
> hits root.
>
> Unfortunatly, this approach causes kernel panics. e.g., the attached
> code snippet will inevitably bring down the machine if I call it
> during in my replacement open, mkdir, rmdir, unlink routines -- and
> tehy all work fine without itq.
Use d_path. NOTE: the buffer in which the pathname is returned is
the return value of the function and _not_ the buffer you gave to it.
Christoph
--
Of course it doesn't work. We've performed a software upgrade.
next prev parent reply other threads:[~2001-04-17 12:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-16 22:42 kernel space getcwd()? (using current() to find out cwd) Michael L. Welles
2001-04-17 12:30 ` Christoph Hellwig [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-04-17 22:43 Brian J. Watson
2001-04-17 23:28 ` Brian J. Watson
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=200104171230.OAA23346@ns.caldera.de \
--to=hch@ns.caldera.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mike@bangstate.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox