projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0471a9c
)
ovl: add WARN_ON() for non-dir redirect cases
author
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 12 Apr 2018 10:04:49 +0000
(12:04 +0200)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 12 Apr 2018 10:04:49 +0000
(12:04 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/namei.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/overlayfs/namei.c
b/fs/overlayfs/namei.c
index 72230b759b58a29f45ebd1808a5b1c81ec27525b..52f0b13be6337c90c45bdea0073e40500859442a 100644
(file)
--- a/
fs/overlayfs/namei.c
+++ b/
fs/overlayfs/namei.c
@@
-256,6
+256,12
@@
static int ovl_lookup_single(struct dentry *base, struct ovl_lookup_data *d,
d->stop = true;
if (d->is_dir)
goto put_and_out;
+
+ /*
+ * NB: handle failure to lookup non-last element when non-dir
+ * redirects become possible
+ */
+ WARN_ON(!last_element);
goto out;
}
if (last_element)
@@
-1006,6
+1012,11
@@
struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
if (IS_ERR(inode))
goto out_free_oe;
+ /*
+ * NB: handle redirected hard links when non-dir redirects
+ * become possible
+ */
+ WARN_ON(OVL_I(inode)->redirect);
OVL_I(inode)->redirect = upperredirect;
}