]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: store real inode pointer in ->i_private
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 29 Jul 2016 10:05:24 +0000 (12:05 +0200)
committerShan Hai <shan.hai@oracle.com>
Fri, 4 Aug 2017 05:50:49 +0000 (13:50 +0800)
commit217200edc1402299ab4108583c7d52db43fc1371
tree24b14404fe913c66ed3654a9ef25361a40484db8
parentfe16fe474a62274c5eaf589244c88eae72c8752b
ovl: store real inode pointer in ->i_private

To get from overlay inode to real inode we currently use 'struct
ovl_entry', which has lifetime connected to overlay dentry.  This is okay,
since each overlay dentry had a new overlay inode allocated.

Following patch will break that assumption, so need to leave out ovl_entry.
This patch stores the real inode directly in i_private, with the lowest bit
used to indicate whether the inode is upper or lower.

Lifetime rules remain, using ovl_inode_real() must only be done while
caller holds ref on overlay dentry (and hence on real dentry), or within
RCU protected regions.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Orabug: 26401569

(backport upstream commit 39b681f8026c170a73972517269efc830db0d7ce)

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
fs/overlayfs/copy_up.c
fs/overlayfs/dir.c
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h
fs/overlayfs/super.c