linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] overlayfs fixes
@ 2010-11-17 17:37 Andy Whitcroft
  2010-11-17 17:37 ` [PATCH 1/2] overlayfs: handle missing lower inodes in ovl_is_same_inode Andy Whitcroft
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Whitcroft @ 2010-11-17 17:37 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: linux-fsdevel, linux-kernel, vaurora, neilb, viro, Andy Whitcroft

I did some further testing of overlayfs using it to boot a live filesystem,
which was unsuccessful overall.  I found a couple of issues thrown up by
using squashfs as the underlying layer. Following this email are a couple
of fixes I used to get much closer.

Also, do you have a rebased version of this code for v2.6.37-rc2?
I had a quick run at it and ended up messing it up (panics on boot).

-apw

Andy Whitcroft (2):
  overlayfs: handle missing lower inodes in ovl_is_same_inode
  overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr

 fs/overlayfs/overlayfs.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

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

* [PATCH 1/2] overlayfs: handle missing lower inodes in ovl_is_same_inode
  2010-11-17 17:37 [PATCH 0/2] overlayfs fixes Andy Whitcroft
@ 2010-11-17 17:37 ` Andy Whitcroft
  2010-11-17 17:37 ` [PATCH 2/2] overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr Andy Whitcroft
  2010-11-25 15:06 ` [PATCH 0/2] overlayfs fixes Miklos Szeredi
  2 siblings, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2010-11-17 17:37 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: linux-fsdevel, linux-kernel, vaurora, neilb, viro, Andy Whitcroft

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 fs/overlayfs/overlayfs.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
index 63afa3d..6b8a7b9 100644
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -1948,19 +1948,25 @@ static int ovl_remount_fs(struct super_block *sb, int *flagsp, char *data)
 
 static bool ovl_is_same_inode(struct dentry *d1, struct dentry *d2)
 {
-	struct dentry *upperd1;
-	struct dentry *upperd2;
+	struct dentry *od1;
+	struct dentry *od2;
 
-	upperd1 = ovl_dentry_upper(d1);
-	upperd2 = ovl_dentry_upper(d2);
+	od1 = ovl_dentry_upper(d1);
+	od2 = ovl_dentry_upper(d2);
 
-	if (upperd1 && upperd2)
-		return vfs_is_same_inode(upperd1, upperd2);
+	if (od1 && od2)
+		return vfs_is_same_inode(od1, od2);
 
-	if (upperd1 || upperd2)
+	if (od1 || od2)
 		return false;
 
-	return vfs_is_same_inode(ovl_dentry_lower(d1), ovl_dentry_lower(d2));
+	od1 = ovl_dentry_lower(d1);
+	od2 = ovl_dentry_lower(d2);
+
+	if (od1 && od2)
+		return vfs_is_same_inode(od1, od2);
+
+	return false;
 }
 
 /**
-- 
1.7.0.4

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

* [PATCH 2/2] overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr
  2010-11-17 17:37 [PATCH 0/2] overlayfs fixes Andy Whitcroft
  2010-11-17 17:37 ` [PATCH 1/2] overlayfs: handle missing lower inodes in ovl_is_same_inode Andy Whitcroft
@ 2010-11-17 17:37 ` Andy Whitcroft
  2010-11-25 15:06 ` [PATCH 0/2] overlayfs fixes Miklos Szeredi
  2 siblings, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2010-11-17 17:37 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: linux-fsdevel, linux-kernel, vaurora, neilb, viro, Andy Whitcroft

Even when an underlying filesystem had a getxattr op it may not support
xattrs.  In this case vfs_listxattr will return EOPNOTSUPP.  Handle
this return when copying up attributes.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 fs/overlayfs/overlayfs.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
index 6b8a7b9..1148b8c 100644
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -692,8 +692,11 @@ static int ovl_copy_up_xattr(struct dentry *old, struct dentry *new)
 		return 0;
 
 	list_size = vfs_listxattr(old, NULL, 0);
-	if (list_size <= 0)
+	if (list_size <= 0) {
+		if (list_size == -EOPNOTSUPP)
+			return 0;
 		return list_size;
+	}
 
 	buf = kzalloc(list_size, GFP_KERNEL);
 	if (!buf)
-- 
1.7.0.4


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

* Re: [PATCH 0/2] overlayfs fixes
  2010-11-17 17:37 [PATCH 0/2] overlayfs fixes Andy Whitcroft
  2010-11-17 17:37 ` [PATCH 1/2] overlayfs: handle missing lower inodes in ovl_is_same_inode Andy Whitcroft
  2010-11-17 17:37 ` [PATCH 2/2] overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr Andy Whitcroft
@ 2010-11-25 15:06 ` Miklos Szeredi
  2010-11-28 19:18   ` Andy Whitcroft
  2 siblings, 1 reply; 5+ messages in thread
From: Miklos Szeredi @ 2010-11-25 15:06 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: miklos, linux-fsdevel, linux-kernel, vaurora, neilb, viro, apw

On Wed, 17 Nov 2010, Andy Whitcroft wrote:
>   overlayfs: handle missing lower inodes in ovl_is_same_inode

I don't see how this could be needed.  vfs_is_same_inode() checks if
the dentries are positive.  In that case either the upper dentry or
the lower dentry or both must exist.

>   overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr

Applied.  Thanks, Andy.

I pushed an updated version based on v2.6.37-rc3 to the overlayfs.v5
branch:

  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs.v5

Thanks,
Miklos

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

* Re: [PATCH 0/2] overlayfs fixes
  2010-11-25 15:06 ` [PATCH 0/2] overlayfs fixes Miklos Szeredi
@ 2010-11-28 19:18   ` Andy Whitcroft
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2010-11-28 19:18 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-fsdevel, linux-kernel, vaurora, neilb, viro

On Thu, Nov 25, 2010 at 04:06:55PM +0100, Miklos Szeredi wrote:
> On Wed, 17 Nov 2010, Andy Whitcroft wrote:
> >   overlayfs: handle missing lower inodes in ovl_is_same_inode
> 
> I don't see how this could be needed.  vfs_is_same_inode() checks if
> the dentries are positive.  In that case either the upper dentry or
> the lower dentry or both must exist.

It was cirtinaly exploding in my tests without that change.  The test
case was overlaying a tmpfs over a squashfs.

> >   overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr
> 
> Applied.  Thanks, Andy.
> 
> I pushed an updated version based on v2.6.37-rc3 to the overlayfs.v5
> branch:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs.v5
> 
> Thanks,
> Miklos

I'll retest with that version and see if the first patch is still
required.

Thanks for the updated version.

-apw

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

end of thread, other threads:[~2010-11-28 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 17:37 [PATCH 0/2] overlayfs fixes Andy Whitcroft
2010-11-17 17:37 ` [PATCH 1/2] overlayfs: handle missing lower inodes in ovl_is_same_inode Andy Whitcroft
2010-11-17 17:37 ` [PATCH 2/2] overlayfs: ovl_copy_up_xattr -- handle EOPNOTSUPP from vfs_listxattr Andy Whitcroft
2010-11-25 15:06 ` [PATCH 0/2] overlayfs fixes Miklos Szeredi
2010-11-28 19:18   ` Andy Whitcroft

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