lkml.org 
[lkml]   [2011]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [159/244] ipc/mqueue.c: fix mq_open() return value
----- Original Message -----
> 3.0-stable review patch. If anyone has any objections, please let us
> know.

@@ -160,6 +161,7 @@ static struct inode *mqueue_get_inode(st
u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) {
spin_unlock(&mq_lock);
/* mqueue_evict_inode() releases info->messages */
+ ret = -EMFILE;
goto out_inode;
}
u->mq_bytes += mq_bytes;
NACK to this portion of the patch. The test is for the total bytes allocated, and the RLIMIT is for bytes allocated. This can happen on one file or on the hundredth file. It isn't a file error, it's a memory error and should remain such. If you want to accurately return the right error, then you need new_inode() to return an ERR_PTR(EMFILE) in the case that the number of message queues in the namespace is exceeded and propagate that back up, but as mqueue_get_inode() really only checks memory issues, not queue count issues, the only return it should generate is ENOMEM.

--
Doug Ledford <dledford@redhat.com>
GPG KeyID: CFBFF194
http://people.redhat.com/dledford



\
 
 \ /
  Last update: 2011-09-29 17:45    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site