linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for filesystems with d_revalidate (NFS)
@ 2015-02-09 15:11 Caldwell, Blake A.
  2015-02-09 21:12 ` Eric Jones
  2015-02-11 13:03 ` David Howells
  0 siblings, 2 replies; 6+ messages in thread
From: Caldwell, Blake A. @ 2015-02-09 15:11 UTC (permalink / raw)
  To: linux-unionfs@vger.kernel.org

Hi there,

Is perhaps a fix for disabling overlayfsroot for filesystems with revalidate on the horizon? My use case for overlayfs is a NFS (v3 or v4) lowerdir, which appears rejected by the code below because NFS defines d_revalidate, d_automount, and d_weak_revalidate (v3 only).

There has been discussion in this launchpad bug about xattr copyup problems:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1039402

fs/overlayfs/super.c@692:
       /*
        * We don't support:
        *  - automount filesystems
        *  - filesystems with revalidate (FIXME for lower layer)
        *  - filesystems with case insensitive names
        */
       if (dop &&
           (dop->d_manage || dop->d_automount ||
            dop->d_revalidate || dop->d_weak_revalidate ||
            dop->d_compare || dop->d_hash)) {
               return false;
       }

Regarding the referenced code in overlayfs-next, is there a condition in which NFSv4 could be supported, such as if mounted read-only?

-Blake

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Support for filesystems with d_revalidate (NFS)
  2015-02-09 15:11 Support for filesystems with d_revalidate (NFS) Caldwell, Blake A.
@ 2015-02-09 21:12 ` Eric Jones
  2015-02-10 18:26   ` Caldwell, Blake A.
  2015-02-11 13:03 ` David Howells
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Jones @ 2015-02-09 21:12 UTC (permalink / raw)
  To: Caldwell, Blake A.; +Cc: linux-unionfs@vger.kernel.org

I don't have an answer, but I'll note it worked at some point. For example, the overlayfs code in SuSE's SLES12 release allows it. I'm not sure why Novell merged such a different version of the overlayfs code.


On Mon, Feb 09, 2015 at 03:11:46PM +0000, Caldwell, Blake A. wrote:
> Hi there,
> 
> Is perhaps a fix for disabling overlayfsroot for filesystems with revalidate on the horizon? My use case for overlayfs is a NFS (v3 or v4) lowerdir, which appears rejected by the code below because NFS defines d_revalidate, d_automount, and d_weak_revalidate (v3 only).
> 
> There has been discussion in this launchpad bug about xattr copyup problems:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1039402
> 
> fs/overlayfs/super.c@692:
>        /*
>         * We don't support:
>         *  - automount filesystems
>         *  - filesystems with revalidate (FIXME for lower layer)
>         *  - filesystems with case insensitive names
>         */
>        if (dop &&
>            (dop->d_manage || dop->d_automount ||
>             dop->d_revalidate || dop->d_weak_revalidate ||
>             dop->d_compare || dop->d_hash)) {
>                return false;
>        }
> 
> Regarding the referenced code in overlayfs-next, is there a condition in which NFSv4 could be supported, such as if mounted read-only?
> 
> -Blake
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Support for filesystems with d_revalidate (NFS)
  2015-02-09 21:12 ` Eric Jones
@ 2015-02-10 18:26   ` Caldwell, Blake A.
  2015-02-10 20:28     ` Miklos Szeredi
  0 siblings, 1 reply; 6+ messages in thread
From: Caldwell, Blake A. @ 2015-02-10 18:26 UTC (permalink / raw)
  To: Eric Jones; +Cc: linux-unionfs@vger.kernel.org

Thanks. That could help in the short-term. I'd hope to see see this in mainline eventually. If someone could elaborate on the blanket exclusion of d_revalidate, I'd like to see if the task to add read-only NFS support is reasonable.

-Blake


On Feb 9, 2015, at 2:12 PM, Eric Jones <ejones@cray.com> wrote:

> I don't have an answer, but I'll note it worked at some point. For example, the overlayfs code in SuSE's SLES12 release allows it. I'm not sure why Novell merged such a different version of the overlayfs code.
> 
> 
> On Mon, Feb 09, 2015 at 03:11:46PM +0000, Caldwell, Blake A. wrote:
>> Hi there,
>> 
>> Is perhaps a fix for disabling overlayfsroot for filesystems with revalidate on the horizon? My use case for overlayfs is a NFS (v3 or v4) lowerdir, which appears rejected by the code below because NFS defines d_revalidate, d_automount, and d_weak_revalidate (v3 only).
>> 
>> There has been discussion in this launchpad bug about xattr copyup problems:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1039402
>> 
>> fs/overlayfs/super.c@692:
>>       /*
>>        * We don't support:
>>        *  - automount filesystems
>>        *  - filesystems with revalidate (FIXME for lower layer)
>>        *  - filesystems with case insensitive names
>>        */
>>       if (dop &&
>>           (dop->d_manage || dop->d_automount ||
>>            dop->d_revalidate || dop->d_weak_revalidate ||
>>            dop->d_compare || dop->d_hash)) {
>>               return false;
>>       }
>> 
>> Regarding the referenced code in overlayfs-next, is there a condition in which NFSv4 could be supported, such as if mounted read-only?
>> 
>> -Blake
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Support for filesystems with d_revalidate (NFS)
  2015-02-10 18:26   ` Caldwell, Blake A.
@ 2015-02-10 20:28     ` Miklos Szeredi
  0 siblings, 0 replies; 6+ messages in thread
From: Miklos Szeredi @ 2015-02-10 20:28 UTC (permalink / raw)
  To: Caldwell, Blake A.
  Cc: Eric Jones, linux-unionfs@vger.kernel.org, Linux-Fsdevel

On Tue, Feb 10, 2015 at 7:26 PM, Caldwell, Blake A. <blakec@ornl.gov> wrote:
> Thanks. That could help in the short-term. I'd hope to see see this in mainline eventually. If someone could elaborate on the blanket exclusion of d_revalidate, I'd like to see if the task to add read-only NFS support is reasonable.

It was easier to merge upstream that way (the acutal change was
suggested by Al Viro).  We could add it back if we can show that it
doesn't hurt.

Generally distributed fs need ->d_revalidate because filesystem can
change without any write activity on the local mount (and even if
mounted read-only) to check for remote changes.

Overlayfs assumes that lower fs is constant and behavior is undefined
if the underlying filesystem changes.  So basically we don't care
about d_revalidate, but may still want to call it due to possible
assumptions about it being called by the VFS.

So easy option is to call ->d_revalidate and error out if it returns "invalid"

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Support for filesystems with d_revalidate (NFS)
  2015-02-09 15:11 Support for filesystems with d_revalidate (NFS) Caldwell, Blake A.
  2015-02-09 21:12 ` Eric Jones
@ 2015-02-11 13:03 ` David Howells
  2015-02-11 20:29   ` Caldwell, Blake A.
  1 sibling, 1 reply; 6+ messages in thread
From: David Howells @ 2015-02-11 13:03 UTC (permalink / raw)
  To: Caldwell, Blake A.; +Cc: dhowells, linux-unionfs@vger.kernel.org

Caldwell, Blake A. <blakec@ornl.gov> wrote:

> My use case for overlayfs is a NFS (v3 or v4) lowerdir, which appears
> rejected by the code below because NFS defines d_revalidate, d_automount,
> and d_weak_revalidate (v3 only).

How do you solve the file locking and fanotify problems?

David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Support for filesystems with d_revalidate (NFS)
  2015-02-11 13:03 ` David Howells
@ 2015-02-11 20:29   ` Caldwell, Blake A.
  0 siblings, 0 replies; 6+ messages in thread
From: Caldwell, Blake A. @ 2015-02-11 20:29 UTC (permalink / raw)
  To: David Howells; +Cc: linux-unionfs@vger.kernel.org

On Feb 11, 2015, at 6:03 AM, David Howells <dhowells@redhat.com<mailto:dhowells@redhat.com>> wrote:

Caldwell, Blake A. <blakec@ornl.gov<mailto:blakec@ornl.gov>> wrote:

My use case for overlayfs is a NFS (v3 or v4) lowerdir, which appears
rejected by the code below because NFS defines d_revalidate, d_automount,
and d_weak_revalidate (v3 only).

How do you solve the file locking and fanotify problems?
That's where I need your help :-)

You're lkml post was helpful for me to read
https://lkml.org/lkml/2015/1/26/740

NFS is a bit overkill for distributing a filesystem tree snapshot over the network, but it is an efficient way to do it. Pages are loaded into the page cache, meaning the whole image doesn't need to be transferred over the network. Coherent locking and *notify are complicating the matter, but I could see how supporting them is necessary to declare NFS support. I'm not sure what options exist for this use case, but it seems to be shared by several others.

To describe the desired behavior. When node1 opens a file R/O a local read lock is sufficient. It would prevent processes local to the system from opening an overlapping write lock. If another node, node2, opens the same file R/W it should attempt to take a lock that would conflict with the lock on node1. However, it will invoke copyup on node2 and maintain a write lock. Unintended copyups need to be blocked, or (as you mentioned without proper handling) the resulting copy may lose the lock.

This seems to point towards local only locks -o nlock, and trusting the cluster not to modify the filesystem (to also prevent fanotify). Given the lack of enforcement mechanisms on the client for latter, are we limited to removing that check by hand and compiling a custom kernel, or would an override "mount with possible inconsistency" option be merge-able?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-11 20:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-09 15:11 Support for filesystems with d_revalidate (NFS) Caldwell, Blake A.
2015-02-09 21:12 ` Eric Jones
2015-02-10 18:26   ` Caldwell, Blake A.
2015-02-10 20:28     ` Miklos Szeredi
2015-02-11 13:03 ` David Howells
2015-02-11 20:29   ` Caldwell, Blake A.

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).