On Fri, 23 Feb 2007, Dan Mick wrote:

So, that would be an "error", and, other than reporting it accurately, what would you want ZFS to do to "support" it?

It's not an error for write(2) to return with less bytes written than requested. In some situations, that's pretty much expected. Like, for example, an writing to network sockets. But filesystems may also decide to do short writes, e.g. in the case when the write would extend the file, but the filesystem runs out of space before all of the write completed; it's up to the implementation whether it returns ENOSPC for all of the write or whether it returns the number of bytes successfully written. Same if you exceed the rlimits or quota allocations; if the write is interrupted before completion.


dudekula mastan wrote:
If a write call attempted to write X bytes of data, and if writecall writes only x ( hwere x <X) bytes, then we call that write as short write.
 -Masthan

     > Please let me know the ZFS support for short writes ?

In the sense that it does them ? Well, it's UNIX/POSIX standard to do them, the write(2) manpage puts it like this:

     If a  write() requests that more bytes be written than there
     is  room for-for example, if the write would exceed the pro-
     cess file size limit (see getrlimit(2) and  ulimit(2)),  the
     system file size limit, or the free space on the device-only
     as many bytes as there is room  for  will  be  written.  For
     example,  suppose there is space for 20 bytes more in a file
     before reaching a limit. A write() of 512-bytes returns  20.
     The  next  write()  of  a  non-zero  number of bytes gives a
     failure return (except as noted for pipes and FIFO below).

I.e. you get a partial write before a failing write. ZFS behaves like this (on quota, definitely - "filesystem full" on ZFS is a bit different due to the space needs for COW), just as other filesystems do.

Where have you encountered a filesystem _NOT_ supporting this behaviour ?

FrankH.

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to