From: Erez Zadok Date: Tue, 6 Sep 2011 01:16:06 +0000 (-0400) Subject: Unionfs: find lower inode of unlinked opened files in setattr X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=1b901bb44846fb88d1d6a0faee6972b6d1a9a3ce;p=unionfs-2.6.36.y.git Unionfs: find lower inode of unlinked opened files in setattr To find the inode of a lower file that's open but unlinked, we cannot find it via unionfs_lower_inode as that's NULL; but we can get it properly from lower_dentry->d_inode. Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c index eb03b9b1c33..74b0eadb421 100644 --- a/fs/unionfs/inode.c +++ b/fs/unionfs/inode.c @@ -933,7 +933,12 @@ static int unionfs_setattr(struct dentry *dentry, struct iattr *ia) err = -EINVAL; goto out; } - lower_inode = unionfs_lower_inode(inode); + + /* + * Get the lower inode directly from lower dentry, in case ibstart + * is -1 (which happens when the file is open but unlinked. + */ + lower_inode = lower_dentry->d_inode; /* check if user has permission to change lower inode */ err = inode_change_ok(lower_inode, ia);