linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Brandenburg <martin@omnibond.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mike Marshall <hubcap@omnibond.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Orangefs, v4.5 and the merge window...
Date: Tue, 15 Mar 2016 00:04:48 -0400 (EDT)	[thread overview]
Message-ID: <alpine.OSX.2.20.11.1603142340410.443@mbmbp.mkb.name> (raw)
In-Reply-To: <20160311214745.GT17997@ZenIV.linux.org.uk>

On Fri, 11 Mar 2016, Al Viro wrote:

> IIRC, there also had been some unpleasantness with getattr messing ->i_mode
> halfway through... <checks>  Yes - copy_attributes_to_inode() will be called,
> and do
>        inode->i_mode = orangefs_inode_perms(attrs);
> ...
>                inode->i_mode |= S_IFLNK;
> ...
>                        strncpy(orangefs_inode->link_target,
>                                symname,
>                                ORANGEFS_NAME_MAX);
> If nothing else, *another* stat(2) racing with this one could pick the
> intermediate value of ->i_mode and proceed to report it to userland.
> Another problem is overwriting the symlink body; that can get very
> unpleasant, since it might be traversed by another syscall right at that
> moment.  Any change of a symlink body means "we'd missed it going stale";
> there is no way to change a symlink contents without removing it and
> creating a new one.  Should anything other than orangefs_iget() even bother
> copying it?  The same goes for inode type changes, of course (regular
> vs. directory vs. symlink, etc.).

I thought I fixed most of that when I went over
d_revalidate. But now I see that there's the case that
the server attribute changes after revalidate and before
the operation e.g. chmod. What happens to the inode we
now know is stale? What if two processes notice it's
stale at the same time?

We can go ahead with the chmod even if the object type
has changed since the kernel last saw it. But OrangeFS
doesn't have NFS's sillyrename. So what do we do in the
middle of read when we get ENOENT? We ignore POSIX and
return it to userspace anyway and leave the bad inode
around now.

There's lots of unsanitized error codes from the server
going to userspace now.

Will writing i_mode in one shot fix it?

-- Martin

  parent reply	other threads:[~2016-03-15  4:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 20:18 Orangefs, v4.5 and the merge window Mike Marshall
2016-03-11 21:47 ` Al Viro
2016-03-11 22:35   ` Mike Marshall
2016-03-14 21:03     ` Mike Marshall
2016-03-26  0:21       ` Al Viro
2016-03-26  1:00         ` Mike Marshall
     [not found]         ` <CA+55aFzLC_pdj_ds82YYab5D7jpYMj26s0Frofxxhk=j7SqnjA@mail.gmail.com>
2016-03-26  1:01           ` Al Viro
2016-03-26  1:07             ` Mike Marshall
     [not found]             ` <CA+55aFysWS9mP+QgfAR6LZpEbkp61MUPQu0zDoq7cafmr3M8SA@mail.gmail.com>
2016-03-26  3:55               ` Mike Marshall
2016-03-26  4:30                 ` Al Viro
2016-03-26 12:07                   ` Mike Marshall
2016-03-26 14:47                     ` Al Viro
2016-03-26 15:34                       ` Mike Marshall
2016-03-26 15:50                         ` Al Viro
2016-03-26 17:36                           ` Mike Marshall
2016-03-26 18:28                             ` Al Viro
2016-03-26 18:37                               ` Al Viro
2016-03-26 19:00                                 ` Mike Marshall
2016-03-26 19:51                                   ` Linus Torvalds
2016-03-26 20:47                                     ` Mike Marshall
2016-03-26 21:00                                       ` Linus Torvalds
2016-03-26  1:02           ` Mike Marshall
2016-03-15  4:04   ` Martin Brandenburg [this message]
2016-03-15 16:45     ` Martin Brandenburg
2016-03-17 20:45       ` [PATCH] orangefs: getattr work (was: Re: Orangefs, v4.5 and the merge window...) Martin Brandenburg

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=alpine.OSX.2.20.11.1603142340410.443@mbmbp.mkb.name \
    --to=martin@omnibond.com \
    --cc=hubcap@omnibond.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).