<feed xmlns='http://www.w3.org/2005/Atom'>
<title>starfive-tech/linux.git/fs/overlayfs, branch rt-linux-release</title>
<subtitle>StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)</subtitle>
<id>https://git.radix-linux.su/starfive-tech/linux.git/atom?h=rt-linux-release</id>
<link rel='self' href='https://git.radix-linux.su/starfive-tech/linux.git/atom?h=rt-linux-release'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/'/>
<updated>2021-09-28T07:16:12+00:00</updated>
<entry>
<title>ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO</title>
<updated>2021-09-28T07:16:12+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2021-09-27T09:23:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=1dc1eed46f9fa4cb8a07baa24fb44c96d6dd35c9'/>
<id>urn:sha1:1dc1eed46f9fa4cb8a07baa24fb44c96d6dd35c9</id>
<content type='text'>
Normally the check at open time suffices, but e.g loop device does set
IOCB_DIRECT after doing its own checks (which are not sufficent for
overlayfs).

Make sure we don't call the underlying filesystem read/write method with
the IOCB_DIRECT if it's not supported.

Reported-by: Huang Jianan &lt;huangjianan@oppo.com&gt;
Fixes: 16914e6fc7e1 ("ovl: add ovl_read_iter()")
Cc: &lt;stable@vger.kernel.org&gt; # v4.19
Tested-by: Huang Jianan &lt;huangjianan@oppo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix missing negative dentry check in ovl_rename()</title>
<updated>2021-09-24T19:00:31+00:00</updated>
<author>
<name>Zheng Liang</name>
<email>zhengliang6@huawei.com</email>
</author>
<published>2021-09-24T01:16:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=a295aef603e109a47af355477326bd41151765b6'/>
<id>urn:sha1:a295aef603e109a47af355477326bd41151765b6</id>
<content type='text'>
The following reproducer

  mkdir lower upper work merge
  touch lower/old
  touch lower/new
  mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merge
  rm merge/new
  mv merge/old merge/new &amp; unlink upper/new

may result in this race:

PROCESS A:
  rename("merge/old", "merge/new");
  overwrite=true,ovl_lower_positive(old)=true,
  ovl_dentry_is_whiteout(new)=true -&gt; flags |= RENAME_EXCHANGE

PROCESS B:
  unlink("upper/new");

PROCESS A:
  lookup newdentry in new_upperdir
  call vfs_rename() with negative newdentry and RENAME_EXCHANGE

Fix by adding the missing check for negative newdentry.

Signed-off-by: Zheng Liang &lt;zhengliang6@huawei.com&gt;
Fixes: e9be9d5e76e3 ("overlay filesystem")
Cc: &lt;stable@vger.kernel.org&gt; # v3.18
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: enable RCU'd -&gt;get_acl()</title>
<updated>2021-08-18T20:08:24+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2021-08-18T20:08:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=332f606b32b6291a944c8cf23b91f53a6e676525'/>
<id>urn:sha1:332f606b32b6291a944c8cf23b91f53a6e676525</id>
<content type='text'>
Overlayfs does not cache ACL's (to avoid double caching).  Instead it just
calls the underlying filesystem's i_op-&gt;get_acl(), which will return the
cached value, if possible.

In rcu path walk, however, get_cached_acl_rcu() is employed to get the
value from the cache, which will fail on overlayfs resulting in dropping
out of rcu walk mode.  This can result in a big performance hit in certain
situations.

Fix by calling -&gt;get_acl() with rcu=true in case of ACL_DONT_CACHE (which
indicates pass-through)

Reported-by: garyhuang &lt;zjh.20052005@163.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfs: add rcu argument to -&gt;get_acl() callback</title>
<updated>2021-08-18T20:08:24+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2021-08-18T20:08:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=0cad6246621b5887d5b33fea84219d2a71f2f99a'/>
<id>urn:sha1:0cad6246621b5887d5b33fea84219d2a71f2f99a</id>
<content type='text'>
Add a rcu argument to the -&gt;get_acl() callback to allow
get_cached_acl_rcu() to call the -&gt;get_acl() method in the next patch.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup()</title>
<updated>2021-08-17T15:37:53+00:00</updated>
<author>
<name>chenying</name>
<email>chenying.kernel@bytedance.com</email>
</author>
<published>2021-08-16T10:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=52d5a0c6bd8a89f460243ed937856354f8f253a3'/>
<id>urn:sha1:52d5a0c6bd8a89f460243ed937856354f8f253a3</id>
<content type='text'>
If function ovl_instantiate() returns an error, ovl_cleanup will be called
and try to remove newdentry from wdir, but the newdentry has been moved to
udir at this time.  This will causes BUG_ON(victim-&gt;d_parent-&gt;d_inode !=
dir) in fs/namei.c:may_delete.

Signed-off-by: chenying &lt;chenying.kernel@bytedance.com&gt;
Fixes: 01b39dcc9568 ("ovl: use inode_insert5() to hash a newly created inode")
Link: https://lore.kernel.org/linux-unionfs/e6496a94-a161-dc04-c38a-d2544633acb4@bytedance.com/
Cc: &lt;stable@vger.kernel.org&gt; # v4.18
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: use kvalloc in xattr copy-up</title>
<updated>2021-08-17T09:47:45+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2021-07-22T12:18:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=f945ca1963c8bd29471020d7c58c594ee7007006'/>
<id>urn:sha1:f945ca1963c8bd29471020d7c58c594ee7007006</id>
<content type='text'>
Extended attributes are usually small, but could be up to 64k in size, so
use the most efficient method for doing the allocation.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: update ctime when changing fileattr</title>
<updated>2021-08-17T09:47:44+00:00</updated>
<author>
<name>Chengguang Xu</name>
<email>cgxu519@mykernel.net</email>
</author>
<published>2021-03-10T02:09:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=d8991e8622e758b718e2e4291d31dd0bea4e14a4'/>
<id>urn:sha1:d8991e8622e758b718e2e4291d31dd0bea4e14a4</id>
<content type='text'>
Currently we keep size, mode and times of overlay inode
as the same as upper inode, so should update ctime when
changing file attribution as well.

Signed-off-by: Chengguang Xu &lt;cgxu519@mykernel.net&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: skip checking lower file's i_writecount on truncate</title>
<updated>2021-08-17T09:47:44+00:00</updated>
<author>
<name>Chengguang Xu</name>
<email>cgxu519@mykernel.net</email>
</author>
<published>2021-04-24T14:03:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=b71759ef1e1730db81dab98e9dab9455e8c7f5a2'/>
<id>urn:sha1:b71759ef1e1730db81dab98e9dab9455e8c7f5a2</id>
<content type='text'>
It is possible that a directory tree is shared between multiple overlay
instances as a lower layer.  In this case when one instance executes a file
residing on the lower layer, the other instance denies a truncate(2) call
on this file.

This only happens for truncate(2) and not for open(2) with the O_TRUNC
flag.

Fix this interference and inconsistency by removing the preliminary
i_writecount check before copy-up.

This means that unlike on normal filesystems truncate(argv[0]) will now
succeed.  If this ever causes a regression in a real world use case this
needs to be revisited.

One way to fix this properly would be to keep a correct i_writecount in the
overlay inode, but that is difficult due to memory mapping code only
dealing with the real file/inode.

Signed-off-by: Chengguang Xu &lt;cgxu519@mykernel.net&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: relax lookup error on mismatch origin ftype</title>
<updated>2021-08-17T09:47:44+00:00</updated>
<author>
<name>Amir Goldstein</name>
<email>amir73il@gmail.com</email>
</author>
<published>2021-04-27T10:28:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=ffb24e3c657869b256c3f90792d262fe09f49628'/>
<id>urn:sha1:ffb24e3c657869b256c3f90792d262fe09f49628</id>
<content type='text'>
We get occasional reports of lookup errors due to mismatched
origin ftype from users that re-format a lower squashfs image.

Commit 13c6ad0f45fd ("ovl: document lower modification caveats")
tries to discourage the practice of re-formating lower layers and
describes the expected behavior as undefined.

Commit b0e0f69731cd ("ovl: restrict lower null uuid for "xino=auto"")
limits the configurations in which origin file handles are followed.

In addition to these measures, change the behavior in case of detecting
a mismatch origin ftype in lookup to issue a warning, not follow origin,
but not fail the lookup operation either.

That should make overall more users happy without any big consequences.

Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxgPq9E9xxwU2CDyHy-_yCZZeymg+3n+-6AqkGGE1YtwvQ@mail.gmail.com/
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: do not set overlay.opaque for new directories</title>
<updated>2021-08-17T09:47:44+00:00</updated>
<author>
<name>Vyacheslav Yurkov</name>
<email>Vyacheslav.Yurkov@bruker.com</email>
</author>
<published>2021-05-27T17:45:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=1fc31aac96d7060ecee18124be6de18cb2268922'/>
<id>urn:sha1:1fc31aac96d7060ecee18124be6de18cb2268922</id>
<content type='text'>
Enable optimizations only if user opted-in for any of extended features.
If optimization is enabled, it breaks existing use case when a lower layer
directory appears after directory was created on a merged layer. If
overlay.opaque is applied, new files on lower layer are not visible.

Consider the following scenario:
- /lower and /upper are mounted to /merged
- directory /merged/new-dir is created with a file test1
- overlay is unmounted
- directory /lower/new-dir is created with a file test2
- overlay is mounted again

If opaque is applied by default, file test2 is not going to be visible
without explicitly clearing the overlay.opaque attribute

Signed-off-by: Vyacheslav Yurkov &lt;Vyacheslav.Yurkov@bruker.com&gt;
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
