[SRU,DISCO,EOAN] UBUNTU: SAUCE: shiftfs: setup correct s_maxbytes limit
diff mbox series

Message ID 20191023122228.2102-1-christian.brauner@ubuntu.com
State New
Headers show
Series
  • [SRU,DISCO,EOAN] UBUNTU: SAUCE: shiftfs: setup correct s_maxbytes limit
Related show

Commit Message

Christian Brauner Oct. 23, 2019, 12:22 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1849482

Set the s_maxbytes limit to MAX_LFS_FILESIZE.
Currently shiftfs limits the maximum size for fallocate() needlessly
causing calls such as fallocate --length 2GB ./file to fail. This
limitation is arbitrary since it's not caused by the underlay but
rather by shiftfs itself capping the s_maxbytes. This causes bugs such
as the one reported in [1].

[1]: https://github.com/lxc/lxd/issues/6333
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
---
 fs/shiftfs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Connor Kuehl Oct. 31, 2019, 9:49 p.m. UTC | #1
On 10/23/19 5:22 AM, Christian Brauner wrote:
> BugLink: https://bugs.launchpad.net/bugs/1849482
> 
> Set the s_maxbytes limit to MAX_LFS_FILESIZE.
> Currently shiftfs limits the maximum size for fallocate() needlessly
> causing calls such as fallocate --length 2GB ./file to fail. This
> limitation is arbitrary since it's not caused by the underlay but
> rather by shiftfs itself capping the s_maxbytes. This causes bugs such
> as the one reported in [1].
> 
> [1]: https://github.com/lxc/lxd/issues/6333
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>

Acked-by: Connor Kuehl <connor.kuehl@canonical.com>

> ---
>   fs/shiftfs.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/shiftfs.c b/fs/shiftfs.c
> index 55bb32b611f2..ac22a5bf5b1f 100644
> --- a/fs/shiftfs.c
> +++ b/fs/shiftfs.c
> @@ -2057,6 +2057,7 @@ static int shiftfs_fill_super(struct super_block *sb, void *raw_data,
>   	inode->i_private = dentry->d_inode;
>   
>   	sb->s_magic = SHIFTFS_MAGIC;
> +	sb->s_maxbytes = MAX_LFS_FILESIZE;
>   	sb->s_op = &shiftfs_super_ops;
>   	sb->s_xattr = shiftfs_xattr_handlers;
>   	sb->s_d_op = &shiftfs_dentry_ops;
>
Stefan Bader Nov. 7, 2019, 4:24 p.m. UTC | #2
On 23.10.19 14:22, Christian Brauner wrote:
> BugLink: https://bugs.launchpad.net/bugs/1849482
> 
> Set the s_maxbytes limit to MAX_LFS_FILESIZE.
> Currently shiftfs limits the maximum size for fallocate() needlessly
> causing calls such as fallocate --length 2GB ./file to fail. This
> limitation is arbitrary since it's not caused by the underlay but
> rather by shiftfs itself capping the s_maxbytes. This causes bugs such
> as the one reported in [1].
> 
> [1]: https://github.com/lxc/lxd/issues/6333
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  fs/shiftfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/shiftfs.c b/fs/shiftfs.c
> index 55bb32b611f2..ac22a5bf5b1f 100644
> --- a/fs/shiftfs.c
> +++ b/fs/shiftfs.c
> @@ -2057,6 +2057,7 @@ static int shiftfs_fill_super(struct super_block *sb, void *raw_data,
>  	inode->i_private = dentry->d_inode;
>  
>  	sb->s_magic = SHIFTFS_MAGIC;
> +	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_op = &shiftfs_super_ops;
>  	sb->s_xattr = shiftfs_xattr_handlers;
>  	sb->s_d_op = &shiftfs_dentry_ops;
>
Khaled Elmously Nov. 9, 2019, 6:47 a.m. UTC | #3
On 2019-10-23 14:22:28 , Christian Brauner wrote:
> BugLink: https://bugs.launchpad.net/bugs/1849482
> 
> Set the s_maxbytes limit to MAX_LFS_FILESIZE.
> Currently shiftfs limits the maximum size for fallocate() needlessly
> causing calls such as fallocate --length 2GB ./file to fail. This
> limitation is arbitrary since it's not caused by the underlay but
> rather by shiftfs itself capping the s_maxbytes. This causes bugs such
> as the one reported in [1].
> 
> [1]: https://github.com/lxc/lxd/issues/6333
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
>  fs/shiftfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/shiftfs.c b/fs/shiftfs.c
> index 55bb32b611f2..ac22a5bf5b1f 100644
> --- a/fs/shiftfs.c
> +++ b/fs/shiftfs.c
> @@ -2057,6 +2057,7 @@ static int shiftfs_fill_super(struct super_block *sb, void *raw_data,
>  	inode->i_private = dentry->d_inode;
>  
>  	sb->s_magic = SHIFTFS_MAGIC;
> +	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_op = &shiftfs_super_ops;
>  	sb->s_xattr = shiftfs_xattr_handlers;
>  	sb->s_d_op = &shiftfs_dentry_ops;
> -- 
> 2.23.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Seth Forshee Nov. 11, 2019, 11:57 p.m. UTC | #4
On Wed, Oct 23, 2019 at 02:22:28PM +0200, Christian Brauner wrote:
> BugLink: https://bugs.launchpad.net/bugs/1849482
> 
> Set the s_maxbytes limit to MAX_LFS_FILESIZE.
> Currently shiftfs limits the maximum size for fallocate() needlessly
> causing calls such as fallocate --length 2GB ./file to fail. This
> limitation is arbitrary since it's not caused by the underlay but
> rather by shiftfs itself capping the s_maxbytes. This causes bugs such
> as the one reported in [1].
> 
> [1]: https://github.com/lxc/lxd/issues/6333
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>

Applied to unstable/master, thanks!

Patch
diff mbox series

diff --git a/fs/shiftfs.c b/fs/shiftfs.c
index 55bb32b611f2..ac22a5bf5b1f 100644
--- a/fs/shiftfs.c
+++ b/fs/shiftfs.c
@@ -2057,6 +2057,7 @@  static int shiftfs_fill_super(struct super_block *sb, void *raw_data,
 	inode->i_private = dentry->d_inode;
 
 	sb->s_magic = SHIFTFS_MAGIC;
+	sb->s_maxbytes = MAX_LFS_FILESIZE;
 	sb->s_op = &shiftfs_super_ops;
 	sb->s_xattr = shiftfs_xattr_handlers;
 	sb->s_d_op = &shiftfs_dentry_ops;