xfs
[Top] [All Lists]

Re: [PATCH 4/6] xfs: use memdup_user()

To: Roland Dreier <rdreier@xxxxxxxxx>
Subject: Re: [PATCH 4/6] xfs: use memdup_user()
From: Li Zefan <lizf@xxxxxxxxxxxxxx>
Date: Thu, 09 Apr 2009 08:43:33 +0800
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, felixb@xxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <adabpr76oia.fsf@xxxxxxxxx>
References: <49DC4CC0.9050805@xxxxxxxxxxxxxx> <49DC4D54.3020001@xxxxxxxxxxxxxx> <20090408132254.GA5957@xxxxxxxxxxxxx> <adabpr76oia.fsf@xxxxxxxxx>
User-agent: Thunderbird 2.0.0.9 (X11/20071115)
Roland Dreier wrote:
>  > wouldn't NULL be a better error return for this kind of interface,
>  > matching kmalloc?
> 
> I guess returning an error code from memdup_user() lets callers
> distinguish between ENOMEM and EFAULT.  Not sure if that's important or
> not but there probably are at least some sites that care.
> 

Right, and this API is simlilar to strndup_user().

<Prev in Thread] Current Thread [Next in Thread>