From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Michael Thompson <michael.craig.thompson@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, Michael Halcrow <mike@halcrow.us>,
Michael Thompson <mcthomps@us.ibm.com>
Subject: Re: eCryptfs: Request for review
Date: Wed, 26 Oct 2005 21:13:25 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0510262107430.31781@hermes-1.csi.cam.ac.uk> (raw)
In-Reply-To: <afcef88a0510261305s3f80358aieda9e612d5b2c076@mail.gmail.com>
On Wed, 26 Oct 2005, Michael Thompson wrote:
> Hello again,
>
> In preperation of our submission to the LKML, I have begun running
> sparse on the code, and have discovered that due to the nature of our
> stacked filesystem, we have encountered the following sparse message:
>
> fs/ecryptfs/inode.c:843:60: warning: incorrect type in argument 2
> (different address spaces)
> fs/ecryptfs/inode.c:843:60: expected char [noderef] *<noident><asn:1>
> fs/ecryptfs/inode.c:843:60: got char *[assigned] lower_buf
>
> This is in the function ecryptfs_readlink, which follows the inode
> operations definition of:
> int (*readlink) (struct dentry *, char __user *,int);
>
> The reason we are getting these messages is that we are calling the
> readlink operation of the lower filesystem, but passing it a buffer
> which we allocate. Spare is picking up on the fact that the lower fs's
> readlink expects a buffer of type (char __user*), but we provide
> (char*).
>
> Is it acceptable to do the following:
> char *buffer;
> ...
> lower_fs_inode->i_op->readlink(lower_dentry, (char __user*)lower_buf, bufsiz);
Yes, that is absolutely fine to do.
But I do hope you are doing the necessary get_fs/set_fs magic if you are
passing kernel pointers instead of user space ones... I haven't seen your
code so apologies if I am stating the obvious. If you OTOH don't know
what I am talking about you better learn it fast, e.g. look at
drivers/block/loop.c::__do_lo_send_write() which does it.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
next prev parent reply other threads:[~2005-10-26 20:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-18 19:38 eCryptfs: Request for review Michael Halcrow
2005-10-18 19:59 ` Greg KH
2005-10-19 15:36 ` Charles P. Wright
2005-10-19 19:00 ` Michael Thompson
2005-10-19 19:38 ` Charles P. Wright
2005-10-19 19:55 ` Michael Thompson
2005-10-19 21:02 ` Erez Zadok
2005-10-19 21:38 ` Badari Pulavarty
2005-10-21 21:44 ` Michael Thompson
2005-10-21 21:56 ` Shaya Potter
2005-10-21 22:49 ` Badari Pulavarty
2005-10-24 18:19 ` Michael Thompson
2005-10-26 20:05 ` Michael Thompson
2005-10-26 20:13 ` Anton Altaparmakov [this message]
2005-10-27 13:13 ` Charles P. Wright
2005-10-20 14:25 ` Charles P. Wright
2005-10-26 23:29 ` Michael Thompson
2005-10-27 13:12 ` Charles P. Wright
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.64.0510262107430.31781@hermes-1.csi.cam.ac.uk \
--to=aia21@cam.ac.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mcthomps@us.ibm.com \
--cc=michael.craig.thompson@gmail.com \
--cc=mike@halcrow.us \
/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).