All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Vivek Goyal <vgoyal@redhat.com>,
	"zhangyi (F)" <yi.zhang@huawei.com>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	miaoxie@huawei.com, Theodore Tso <tytso@mit.edu>
Subject: Re: two questiones about overlayfs
Date: Wed, 16 Aug 2017 13:10:46 +0200	[thread overview]
Message-ID: <CAOQ4uxgOM4Va3DnL5q+Oyz-OBtCe8-G0bq_Xf9Kuc8KToKyB5A@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegvwXL01-6FPXcbKcPiOKj+LBp69-eHnhiJtuevQdKd4tQ@mail.gmail.com>

On Wed, Aug 16, 2017 at 12:19 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Tue, Aug 15, 2017 at 6:16 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>> On Tue, Aug 15, 2017 at 5:56 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
>
>>> IIUC, so now "chattr -p <id>" will fail on overlayfs (assume file has not
>>> been copied up yet).
>>>
>>
>> Yap.
>>
>>> IOW, on overlayfs, will it be responsibility of user space to make
>>> sure file has been copied up, for chattr operation to succeed? Does that
>>> mean we need to modify chattr to open file for WRITE instead of READ.
>>>
>>
>> I guess that would make sense.
>> I only wonder what was the reason for chattr to open RDONLY in
>> the first place (cc Ted)??
>
> What about copy up of flags?  Should we?

IMO we should start with copying KSTAT_ATTR_FS_IOC_FLAGS,
which can already be available in kstat.
Other "standard" FS_IOC_FLAGS can be copied up when statx
gets support for those flags.

FYI, chattr [+/-]<flags> does:
- fgetflags(&flags): {open OPEN_FLAGS; ioctl EXT2_IOC_GETFLAGS}
- change flags
- fsetflags(&flags): {open OPEN_FLAGS; ioctl EXT2_IOC_SETFLAGS}

OPEN_FLAGS is defined independently in lib/e2p/f{get,set}flags.c as
(O_RDONLY|O_NONBLOCK|O_LARGEFILE), so technically all it
takes is to change the defined in  lib/e2p/fsetflags.c to O_RDWR
and then chattr [+/-]<flags> can be used for preemptive "copy up flags"
by userspace (*) to work around issues which require flags copy up.

(*) At least with ext4 chattr would only "copy up" the
EXT4_FL_USER_MODIFIABLE flags, which is probably for the best.

Amir.

  parent reply	other threads:[~2017-08-16 11:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07  7:57 two questiones about overlayfs zhangyi (F)
2017-08-08  5:01 ` Amir Goldstein
2017-08-08 20:21   ` Vivek Goyal
2017-08-08 21:01     ` Daniel Walsh
2017-08-15 10:22   ` Miklos Szeredi
2017-08-15 13:35   ` Miklos Szeredi
2017-08-15 14:52     ` Amir Goldstein
2017-08-15 15:06       ` Miklos Szeredi
2017-08-15 15:28         ` Amir Goldstein
2017-08-15 15:33           ` Miklos Szeredi
2017-08-15 15:53             ` Amir Goldstein
2017-08-15 15:56             ` Vivek Goyal
2017-08-15 16:16               ` Amir Goldstein
2017-08-16 10:19                 ` Miklos Szeredi
2017-08-16 10:20                   ` Miklos Szeredi
2017-08-16 11:10                   ` Amir Goldstein [this message]
2017-08-17  2:55                     ` zhangyi (F)
2017-08-17  7:49                       ` Amir Goldstein
2017-08-16 13:52                   ` Vivek Goyal
2017-08-16 16:12                     ` Amir Goldstein
2017-08-16 18:37                       ` Vivek Goyal
2017-09-11 13:34 ` Amir Goldstein
2017-09-12  1:07   ` zhangyi (F)

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=CAOQ4uxgOM4Va3DnL5q+Oyz-OBtCe8-G0bq_Xf9Kuc8KToKyB5A@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    --cc=vgoyal@redhat.com \
    --cc=yi.zhang@huawei.com \
    /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.