Re: [PATCH v2 05/11] ovl: lookup redirect by file handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 27, 2017 at 8:27 AM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> Let me try to explain the problem with a worse case, but not
> improbable example:
>
> Suppose I have an overlay with deep file at /a/b/c/.../z
> Suppose the layers are at /old/{lower,upper} I copy them
> over to /new/{lower,upper} and mount the overlay at new path.
>
> Suppose that dcache is fully populated under /new and fully
> evicted under /old.
>
> When trying to decode the file handle for z, exportfs_decode_fh()
> will call the file system to actually read all directories a..z from disk
> in order to reconnect the dentry of old z all the way up to /old
> and it will do that *before* calling the acceptable() callback.
>
> Alternatively, if we first try to decode the file handle for /old/lower,
> decoding will be very fast (most likely already in cache) and we will
> not have to continue to decoding z and reading all directories a..z
> from disk.

To answer my own question in the prev mail: we need to decode the fh
and not just blindly use the inum to prevent issues with
copied/mutilited/etc lower layers.

And yes, in the copied case decoding origin.root first would be a good
optimization that couldn't be done without it.

> Wait, what do you mean by "we don't special case the layer root?"
> Do you mean that we could mount an overlay at a subdir path?
> i.e. in the example below, we could mount an overlay with
> upperdir=/new/upper/a/b/c,lowerdir=/new/lower/a/b/c?
>
> If this is what you mean then it is not true that we don't special case
> layer root. We do it with path redirect relative to layer root.
> If anything, we should be storing origin.root along with overlay.redirect
> in order to verify that we are not redirecting into the wrong relative
> path.

Yeah, you're right, we are special casing layer root.
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux