Project

General

Profile

Bug #8311

ZFS_READONLY is a little too strict

Added by Yuri Pankov over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2017-06-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Description:

There was a misunderstanding about the enforcement details of the "Read-only" flag introduced for SMB/CIFS compatibility, way back in 2007 in the Sun PSARC 2007/315 case.

The original authors thought enforcement of the READONLY flag should work similarly as the IMMUTABLE flag. Unfortunately, that enforcement is incompatible with the expectations of Windows applications using this feature through the SMB service. Applications assume (and the MS File System Algorithms MS-FSA confirms they should) that an SMB client can:

(a) Open an SMB handle on a file with read/write access,
(b) Set the DOS attributes to include the READONLY flag,
(c) continue to have write access via that handle.

This access model is essentially the same as a Unix/POSIX application that creates a file (with read/write access), uses fchmod() to change the file mode to something not granting write access (i.e. 0444), and then continues to write that file using the open handle it got before the mode change.

Currently, the SMB server works-around this problem in a way that will become difficult to maintain as we implement support for SMB3 persistent handles, so SMB depends on this fix.

I've written a test program that can be used to demonstrate this problem, and added it to zfs-tests (tests/functional/acl/cifs/cifs_attr_004_pos).
It currently fails, but will pass when this problem fixed.

Steps to Reproduce:
Run the test program on a ZFS file system.

Expected Results:
Pass

Actual Results:
Fail.

History

#1

Updated by Electric Monk over 2 years ago

  • % Done changed from 50 to 100
  • Status changed from In Progress to Closed

git commit 2889ec41c05e9ffe1890b529b3111354da325aeb

commit  2889ec41c05e9ffe1890b529b3111354da325aeb
Author: Gordon Ross <gwr@nexenta.com>
Date:   2017-06-14T04:28:05.000Z

    8311 ZFS_READONLY is a little too strict
    Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Matt Ahrens <mahrens@delphix.com>
    Reviewed by: John Kennedy <john.kennedy@delphix.com>
    Approved by: Prakash Surya <prakash.surya@delphix.com>

Also available in: Atom PDF