Better create disposition.

Steven French sfrench at us.ibm.com
Tue Aug 26 20:11:27 GMT 2003






I just worked through the following table independently (from the specs)
and rechecked it with Amrut's suggestion and it agrees with his mappings
and seems to agree with Samba conclusions as well.   Now each has to be
tested (do you have a testcase for these 5 valid O_ flag combinations
against each of the two cases: file doesn't exist vs. file exists = 10
total combinations ) which is a mess for 2.4 vs. 2.6 because kernel code
gets in the way and the "lookup intent" enhancements don't seem to fix all
cases to be optimal (ie one sys_open call results in one CIFS VFS request -
currently a few of these result in multiple frames of network traffic due
to the way the kernel breaks apart the "atomic" sys_open request to be not
atomic)
|--------------+--------------+--------------+--------------+--------------|
|If file exists|If file does  |Conclusion    |NTCreateX     |POSIX open    |
|              |not exist     |              |disposition   |flag          |
|--------------+--------------+--------------+--------------+--------------|
|open          |create        |mapping works |FILE_OPEN_IF  |O_CREAT       |
|--------------+--------------+--------------+--------------+--------------|
|open          |fail          |mapping works |FILE_OPEN     |none set      |
|--------------+--------------+--------------+--------------+--------------|
|truncate (keep|create        |mapping works |FILE_OVERWRITE|O_TRUNC |     |
|attrs)        |              |              |_IF           |O_CREAT       |
|--------------+--------------+--------------+--------------+--------------|
|truncate (keep|fail          |mapping works |FILE_OVERWRITE|O_TRUNC       |
|attrs)        |              |              |              |              |
|--------------+--------------+--------------+--------------+--------------|
|create change |create        |no POSIX      |FILE_SUPERSEDE|              |
|attrs         |              |equivalent    |              |              |
|--------------+--------------+--------------+--------------+--------------|
|create change |fail          |no Windows or |N/A           |N/A           |
|attrs         |              |POSIX         |              |              |
|--------------+--------------+--------------+--------------+--------------|
|fail          |create        |mapping works |FILE_CREATE   |O_CREAT |     |
|              |              |              |              |O_EXCL        |
|--------------+--------------+--------------+--------------+--------------|
|fail          |fail          |N/A           |N/A           |N/A           |
|--------------+--------------+--------------+--------------+--------------|





Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com




More information about the samba-technical mailing list