All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Lopes <jabolopes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] Make file struct available to fchmod FS handlers.
Date: Thu, 03 Nov 2016 10:26:14 +0000	[thread overview]
Message-ID: <CANnRPkmFe1mj2jKmP1BSAYSikHpxZpTw8Ctxjmi8xGQ0=v-+7A@mail.gmail.com> (raw)
In-Reply-To: <581AF3CB.3090001-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1916 bytes --]

Hi,

On Thu, Nov 3, 2016 at 9:22 AM Jean-Pierre André <
jean-pierre.andre-39ZsbGIQGT5GWvitb5QawA@public.gmane.org> wrote:

> Al Viro wrote:
> > On Wed, Nov 02, 2016 at 11:53:40PM +0100, Jose Lopes wrote:
> >> Syscall 'ftruncate' makes the 'file' struct available to filesystem
> >> handlers. This makes it possible, e.g., for filesystems, such as,
> >> FUSE, to access the file handle associated with the file descriptor
> >> that was passed to 'ftruncate'. In the specific case of FUSE, this
> >> also makes it possible for (userspace) FUSE-based filesystems to
> >> distinguish between calls to 'truncate' and 'ftruncate'.
> >
> > Why FUSE is such a precious snowflake that it needs to make that
> distinction,
> > unlike all other filesystems?
>
> For fuse file system which delegate the permission checks
> to user space (and have to do so because of cacheing
> issues), the write permission has to be checked for
> truncate(), and not checked for ftruncate() : the file
> may have been opened for writing and then its permissions
> set to read-only before the ftruncate() is requested.
> The user space file system can check current permissions,
> not the ones which were set when the file was opened.
>

+1 what Jean-Pierre said.

Also, I work on a FUSE-based network filesystem and the fact that we cannot
distinguish between calls to fchmod and chmod produces incorrect results.
For example, in the cases where a file was unlinked or moved, calling fchmod
should apply the change directly in the open file. However, since the fchmod
call arrives to FUSE as chmod (because of the missing file handle), FUSE
will
try to resolve the path to get to the open file, which fails because the
file was
moved or unlinked, or it will apply the change to the wrong file if in the
meantime
another file was open under the same path of the previous file.


>
> Jean-Pierre
>

[-- Attachment #1.2: Type: text/html, Size: 2953 bytes --]

[-- Attachment #2: Type: text/plain, Size: 323 bytes --]

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi

[-- Attachment #3: Type: text/plain, Size: 119 bytes --]

-- 
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel

  parent reply	other threads:[~2016-11-03 10:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 22:53 [PATCH] Make file struct available to fchmod FS handlers Jose Lopes
2016-11-03  0:59 ` Al Viro
2016-11-03  8:22   ` [fuse-devel] " Jean-Pierre André
     [not found]     ` <581AF3CB.3090001-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2016-11-03 10:26       ` Jose Lopes [this message]
2016-11-17 17:44         ` Eric W. Biederman
2016-11-17 18:39           ` Nikolaus Rath
2016-11-17 19:20             ` Eric W. Biederman
2016-11-17 23:03               ` Stef Bon
2016-11-03 15:22   ` Nikolaus Rath
2016-11-07  4:51     ` Nikolaus Rath
2016-11-09 17:54       ` Jose Lopes
2016-11-07  5:25 ` Nikolaus Rath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANnRPkmFe1mj2jKmP1BSAYSikHpxZpTw8Ctxjmi8xGQ0=v-+7A@mail.gmail.com' \
    --to=jabolopes-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.