diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-06-04 10:48:19 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-06-04 10:48:19 +0200 |
commit | b8e42a651bdee06202ebdd96cff64fdeabd5b1d6 (patch) | |
tree | a3fc302da7b4df46f00c146334d7f6124b6e6a78 /fs/overlayfs/ovl_entry.h | |
parent | ovl: add accessor for ofs->upper_mnt (diff) | |
download | linux-b8e42a651bdee06202ebdd96cff64fdeabd5b1d6.tar.xz linux-b8e42a651bdee06202ebdd96cff64fdeabd5b1d6.zip |
ovl: get rid of redundant members in struct ovl_fs
ofs->upper_mnt is copied to ->layers[0].mnt and ->layers[0].trap could be
used instead of a separate ->upperdir_trap.
Split the lowerdir option early to get the number of layers, then allocate
the ->layers array, and finally fill the upper and lower layers, as before.
Get rid of path_put_init() in ovl_lower_dir(), since the only caller will
take care of that.
[Colin Ian King] Fix null pointer dereference on null stack pointer on
error return found by Coverity.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/ovl_entry.h')
-rw-r--r-- | fs/overlayfs/ovl_entry.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h index 2da0ff355824..b429c80879ee 100644 --- a/fs/overlayfs/ovl_entry.h +++ b/fs/overlayfs/ovl_entry.h @@ -46,7 +46,6 @@ struct ovl_path { /* private information held for overlayfs's superblock */ struct ovl_fs { - struct vfsmount *upper_mnt; unsigned int numlayer; /* Number of unique fs among layers including upper fs */ unsigned int numfs; @@ -70,7 +69,6 @@ struct ovl_fs { bool workdir_locked; bool share_whiteout; /* Traps in ovl inode cache */ - struct inode *upperdir_trap; struct inode *workbasedir_trap; struct inode *workdir_trap; struct inode *indexdir_trap; @@ -84,7 +82,7 @@ struct ovl_fs { static inline struct vfsmount *ovl_upper_mnt(struct ovl_fs *ofs) { - return ofs->upper_mnt; + return ofs->layers[0].mnt; } static inline struct ovl_fs *OVL_FS(struct super_block *sb) |