ovl: Initialize ovl_inode->redirect in ovl_get_inode()
authorVivek Goyal <vgoyal@redhat.com>
Fri, 11 May 2018 15:49:27 +0000 (11:49 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 20 Jul 2018 07:56:05 +0000 (09:56 +0200)
commit9cec54c83a8baba3099bb8b445a735b93ab9511f
tree7e85b17c21e9a38ea73f14ba10bc9e3a115c1ead
parent0c31d675aad949e5dfecf7a32813514423e6c766
ovl: Initialize ovl_inode->redirect in ovl_get_inode()

ovl_inode->redirect is an inode property and should be initialized in
ovl_get_inode() only when we are adding a new inode to cache.  If inode is
already in cache, it is already initialized and we should not be touching
ovl_inode->redirect field.

As of now this is not a problem as redirects are used only for directories
which don't share inode.  But soon I want to use redirects for regular
files also and there it can become an issue.

Hence, move ->redirect initialization in ovl_get_inode().

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c
fs/overlayfs/namei.c
fs/overlayfs/overlayfs.h