2007/440 nbmand changes for CIFS Service

Calum Mackay Calum.Mackay at sun.com
Tue Jul 31 15:54:12 PDT 2007


I'm sponsoring the following fast-track for Bob Mastors.

The case seeks Minor binding, and the timer is set to next Wednesday, 
8th August.

cheers,
calum.


INTRODUCTION

   This fast-track proposes a set of changes to support the CIFS Service
   (PSARC 2006/715).  This case builds on and/or modifies the
   following cases:
      PSARC 2000/007 "Locking and File Sharing Support"
      PSARC 2007/268 "Support for CIFS share reservations"

   Summary of changes:

   1) Change nbmand file rename/remove share violation checks.
   2) Add support to VOP_SHRLOCK for meta data access with nbmand.
   3) Do not allow nbmand mount option state to change on remount.

NBMAND FILE REMOVE SHARE VIOLATION CHECKS

   The following rule is currently enforced when a file system is
   mounted with the nbmand mount option.

     A request to remove a file will fail if a different process
     has a mandatory share reservation with an access of read,
     write, or remove.

   The CIFS service requires a change in this behavior to remove the
   exception for the process owning the reservation.
   The new rule is as follows:

     A request to remove a file will fail if there is a
     mandatory share reservation with an access of read,
     write, or remove.

NBMAND FILE RENAME SHARE VIOLATION CHECKS

   The following rule is currently enforced when a file system is
   mounted with the nbmand mount option.

     A request to rename a file will fail if a different process
     has a mandatory share reservation with:
        a) access write or access remove
      or
        b) access read and deny remove

   The CIFS service requires a change in this behavior to remove the
   exception for the process owning the reservation.
   The new rule is as follows:

     A request to rename a file will fail there is a
     mandatory share reservation with:
        a) access write or access remove
      or
        b) access read and deny remove

SUPPORT FOR METADATA SHARE RESERVATION

   The CIFS service requires the ability to set a share
   reservation with an access type that indicates metadata
   access.

   The following f_access value will be added to sys/fcntl.h:

     #define F_MDACC  0x8    /* private flag: Metadata share access */

   This value is only allowed on regular files on a file system
   mounted with the "nbmand" option. VOP_SHRLOCK will fail
   the request and return EINVAL if these conditions are not met.

   Metadata access does not change the behavior of the system.
   Specifically the following statements apply:

     A request for metadata access will not fail because of any
     other share reservations on the file.

     An access type of F_MDACC on a mandatory share reservation
     does not modify the behavior of the existing share reservation
     conflict checks. Or phrased another way, the share reservation
     conflict checks ignore share reservations that only
     have metadata access.

NBMAND MOUNT OPTION CHANGE ON REMOUNT

   The final materials for PSARC case 2000/007 state the
   following with regards to the nbmand mount option:

       The remount option cannot change the nbmand
       disposition of the file system.

   However there is a note in the mail for the case that
   nbmand state would be allowed to be changed via remount.
   The implementation reflects this.
   Background can be found in:
       4413031 Cannot mount root or /usr filesystem with nbmand option

   There are problems associated with allowing
   the nbmand state to be changed on remount.
   It is difficult to define useful behavior for files
   that are open at the time of the change of nbmand state.
   It is expensive to reliably test all of the possible
   edge conditions associated with changing the nbmand state.

   To address these problems the CIFS service requires
   that the state of the nbmand mount option cannot be changed
   via remount. The only supported method for changing the
   nbmand state is via unmount/mount.

   The impact of this change is that / and /usr cannot
   be mounted with nbmand. The mount(1M) man page already
   states that / and /usr should not be mounted with nbmand.
   The man page will be updated to reflect the new behavior.

EXPORTED INTERFACES:

                         |Proposed       |Specified      |
                         |Stability      |in what        |
Interface Name          |Classification |Document?      | Comments
===============================================================================
                         |Consolidation  |This           |
  F_MDACC                |Private        |Document       | Metadata 
share access
                         |               |               |




More information about the opensolaris-arc mailing list