Can you solve the problem of not knowing the inode information when modifying the path of upperdir in overlayfs?
After changing the upperdir path:
root@bcd0d4e391f8:~/myDir# ls -i
ls: cannot access 'ssd.c': No such file or directory
ls: cannot access 'ssd.abc': No such file or directory
? ssd.abc ? ssd.c
*The upperdir path was modified by changing the overlayfs code.
*Original code
static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
struct ovl_cattr *attr){
struct dentry *upperdir = ovl_dentry_upper(dentry->d_parent);
struct inode *udir = upperdir->d_inode;
struct dentry *newdentry;
int err;
newdentry = ovl_create_real(udir,
lookup_one_len(dentry->d_name.name,
upperdir,
dentry->d_name.len),
attr);
*Fix code example
static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
struct ovl_cattr *attr){
struct dentry *upperdir = ovl_dentry_upper(dentry->d_parent);
struct inode *udir = upperdir->d_inode;
struct dentry *newdentry;
int err;
extern struct qsh_metadata qsh_mt; //HOON
newdentry = ovl_create_real(qsh_mt.qsh_dentry->d_inode,
lookup_one_len(dentry->d_name.name,
qsh_mt.qsh_dentry,
dentry->d_name.len),
attr);
*In the above code, I replaced the upperdir part with the disk I want and the mounted dentry object. *extern struct qsh_metadata qsh_mt; => Code I added
ex) struct dentry upperdir = qsh_dentry;
docker base mount : /dev/sda
qsh_dentry : mount /dev/sdb