aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-12-12 18:59:45 -0500
committerMiklos Szeredi <mszeredi@suse.cz>2014-12-12 18:59:45 -0500
commit09e10322b71716adf567d453889ef0871cf226b9 (patch)
tree5c2287a55fbdf929e6131834c686a888046b5def /fs
parent3e01cee3b980f96463cb6f378ab05303a99903d9 (diff)
ovl: lookup ENAMETOOLONG on lower means ENOENT
"Suppose you have in one of the lower layers a filesystem with ->lookup()-enforced upper limit on name length. Pretty much every local fs has one, but... they are not all equal. 255 characters is the common upper limit, but e.g. jffs2 stops at 254, minixfs upper limit is somewhere from 14 to 60, depending upon version, etc. You are doing a lookup for something that is present in upper layer, but happens to be too long for one of the lower layers. Too bad - ENAMETOOLONG for you..." Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/super.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 5dbc6789fd5f..110c968dcb3b 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -376,8 +376,14 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
376 opaque = false; 376 opaque = false;
377 this = ovl_lookup_real(lowerpath.dentry, &dentry->d_name); 377 this = ovl_lookup_real(lowerpath.dentry, &dentry->d_name);
378 err = PTR_ERR(this); 378 err = PTR_ERR(this);
379 if (IS_ERR(this)) 379 if (IS_ERR(this)) {
380 /*
381 * If it's positive, then treat ENAMETOOLONG as ENOENT.
382 */
383 if (err == -ENAMETOOLONG && (upperdentry || ctr))
384 continue;
380 goto out_put; 385 goto out_put;
386 }
381 if (!this) 387 if (!this)
382 continue; 388 continue;
383 if (ovl_is_whiteout(this)) { 389 if (ovl_is_whiteout(this)) {