From: Nathan Scott <nathans@sgi.com>
To: Pekka Enberg <penberg@gmail.com>
Cc: Dmitry Torokhov <dtor_core@ameritech.net>,
linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: sysfs: write returns ENOMEM?
Date: Tue, 23 Aug 2005 17:32:58 +1000 [thread overview]
Message-ID: <20050823073258.GE743@frodo> (raw)
In-Reply-To: <200508190055.25747.dtor_core@ameritech.net>
> On 8/19/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > According to the SuS write() can not return ENOMEM, only ENOBUFS is allowed
> > (surprisingly read() is allowed to use both ENOMEM and ENOBUFS):
> >
> > http://www.opengroup.org/onlinepubs/000095399/functions/write.html
> >
> > Should we adjust sysfs write to follow the standard?
>
> Please note that sysfs is not the only one to do this. A quick peek
> reveals XFS and CIFS returing ENOMEM for write() and there are
> probably others as well. Perhaps we should replace ENOMEM with ENOBUFS
FWIW, all filesystems using the generic page cache routines are able
to return this - see mm/filemap.c -> generic_file_buffered_write...
page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
if (!page) {
status = -ENOMEM;
break;
}
which is a similar condition to the one under which the XFS code is
returning this error. Let me know what the verdict is and I'll get
the XFS side of this merged if its really necessary.
cheers.
--
Nathan
next prev parent reply other threads:[~2005-08-23 7:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <11394.1124781401@kao2.melbourne.sgi.com>
2005-08-19 5:55 ` sysfs: write returns ENOMEM? Dmitry Torokhov
2005-08-19 7:29 ` Greg KH
2005-08-19 7:39 ` Pekka Enberg
2005-08-23 7:32 ` Nathan Scott [this message]
2005-08-23 7:55 ` Pekka Enberg
2005-08-23 8:28 ` Andrew Morton
2005-08-23 8:36 ` Pekka J Enberg
2005-08-23 8:46 ` [PATCH] mm: return ENOBUFS instead of ENOMEM in generic_file_buffered_write Pekka J Enberg
2005-08-23 11:55 ` Christoph Hellwig
2005-08-23 13:50 ` Dmitry Torokhov
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=20050823073258.GE743@frodo \
--to=nathans@sgi.com \
--cc=dtor_core@ameritech.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@gmail.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