Re: sysfs: write returns ENOMEM?
From: Nathan Scott
Date: Tue Aug 23 2005 - 02:41:58 EST
> On 8/19/05, Dmitry Torokhov <dtor_core@xxxxxxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/