[Devel] [PATCH RH7] ioctl: use sb from file inode when make FIGETBSZ check

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Thu Feb 9 08:11:19 PST 2017


On overlayfs blocksize on super_block is not set, and FIGETBSZ
returns blocksize of an underlying fs, so we also need to do our
check for underlying sb.

Rebase commit a3ee37c28983 ("rh7: import RHEL7 kernel-3.10.0-514.el7")
brought ms commit 4bacc9c9234c ("overlayfs: Make f_path always point
to the overlay and f_inode to the underlay"), so now super block
filp->f_path.dentry->d_inode->i_sb is of overlayfs, not of the
underlying fs as was before.

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 fs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ioctl.c b/fs/ioctl.c
index f0d0cf9..ae33299 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -590,7 +590,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
 
 	case FIGETBSZ:
 	{
-		struct super_block *sb = filp->f_path.dentry->d_inode->i_sb;
+		struct super_block *sb = inode->i_sb;
 		if (sb->s_blocksize == 1ul << sb->s_blocksize_bits)
 			return put_user(inode->i_sb->s_blocksize, argp);
 		/* fail through */
-- 
2.9.3



More information about the Devel mailing list