lkml.org 
[lkml]   [2014]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Kernel errors with overlay filesystem v22
On Thu, May 29, 2014 at 12:28:45PM +0100, David Howells wrote:
>
> This sequence of commands produces both errors:
>
> mount -t tmpfs lower_layer /lower
> mount -t tmpfs upper_layer /upper
> mkdir /upper/upper
> mkdir /upper/work
> mount -t overlayfs overlayfs /mnt -olowerdir=/lower,upperdir=/upper/upper,workdir=/upper/work
> # The lockdep error was reported in the above mount command

The lockdep error is due to lazyness on my part and trying to hold
mnt_want_write() on upper for the lifetime of the overlay. That doesn't work
well with the freeze protection part (sb_start_write()) because then upper can't
be frozen while the overlay is mounted, which is not what we want, I think.

So I'll just have to bite the bullet and add those mnt_want_write/mnt_end_write
to those vfs_* calls that need it.

> umount /mnt
> umount /upper
> # The dentry leak error was reported in the last umount command

Okay, this was just sloppy testing of the workdir thing that was added to this
version. Below patch fixes it.

Thanks,
Miklos


diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 04879abbbf98..3e2cbbce69e1 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -381,6 +381,7 @@ static void ovl_put_super(struct super_block *sb)
if (!(sb->s_flags & MS_RDONLY))
mnt_drop_write(ufs->upper_mnt);

+ dput(ufs->workdir);
mntput(ufs->upper_mnt);
mntput(ufs->lower_mnt);

@@ -706,7 +707,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)

mntput(upperpath.mnt);
mntput(lowerpath.mnt);
- mntput(workpath.mnt);
+ path_put(&workpath);

oe->__upperdentry = dget(upperpath.dentry);
oe->lowerdentry = lowerpath.dentry;

\
 
 \ /
  Last update: 2014-05-29 14:41    [W:0.124 / U:9.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site