All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set
@ 2018-11-22 13:28 dbyin(尹烨)
  2018-11-22 17:58 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: dbyin(尹烨) @ 2018-11-22 13:28 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, linux-kernel, dbyin(尹烨)

When project is set, we should use inode limit minus the used count

Signed-off-by: Ye Yin <dbyin@tencent.com>
---
 fs/xfs/xfs_qm_bhv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index 73a1d77ec187..3091e4bc04ef 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -40,7 +40,7 @@ xfs_fill_statvfs_from_dquot(
                statp->f_files = limit;
                statp->f_ffree =
                        (statp->f_files > dqp->q_res_icount) ?
-                        (statp->f_ffree - dqp->q_res_icount) : 0;
+                        (statp->f_files - dqp->q_res_icount) : 0;
        }
 }
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set
  2018-11-22 13:28 [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set dbyin(尹烨)
@ 2018-11-22 17:58 ` Darrick J. Wong
  2018-11-23  2:10   ` 答复: [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set(Internet mail) dbyin(尹烨)
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2018-11-22 17:58 UTC (permalink / raw)
  To: dbyin(尹烨); +Cc: linux-xfs, linux-kernel

On Thu, Nov 22, 2018 at 01:28:04PM +0000, dbyin(尹烨) wrote:
> When project is set, we should use inode limit minus the used count
> 
> Signed-off-by: Ye Yin <dbyin@tencent.com>

This makes sense to me, but ... it's been broken like this since 2006.
Is there a reason why (someone named Glen) wrote it this way?

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_qm_bhv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
> index 73a1d77ec187..3091e4bc04ef 100644
> --- a/fs/xfs/xfs_qm_bhv.c
> +++ b/fs/xfs/xfs_qm_bhv.c
> @@ -40,7 +40,7 @@ xfs_fill_statvfs_from_dquot(
>                 statp->f_files = limit;
>                 statp->f_ffree =
>                         (statp->f_files > dqp->q_res_icount) ?
> -                        (statp->f_ffree - dqp->q_res_icount) : 0;
> +                        (statp->f_files - dqp->q_res_icount) : 0;
>         }
>  }
>  
> -- 
> 2.16.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 答复: [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set(Internet mail)
  2018-11-22 17:58 ` Darrick J. Wong
@ 2018-11-23  2:10   ` dbyin(尹烨)
  0 siblings, 0 replies; 3+ messages in thread
From: dbyin(尹烨) @ 2018-11-23  2:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, linux-kernel

We set xfs project quota with overlayfs for docker container. When I enter into the container and run the command 'df -ih', the 'IFree' and 'IUsed' are uncorrect:

#df -ih
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
overlay                 1000   -235M    235M    -  /

So I want to fix this flaw, and this is very meaningful for our applications.
Ye

> 
> On Thu, Nov 22, 2018 at 01:28:04PM +0000, dbyin(尹烨) wrote:
> > When project is set, we should use inode limit minus the used count
> >
> > Signed-off-by: Ye Yin <dbyin@tencent.com>
> 
> This makes sense to me, but ... it's been broken like this since 2006.
> Is there a reason why (someone named Glen) wrote it this way?
> 
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> --D
> 
> > ---
> >  fs/xfs/xfs_qm_bhv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c index
> > 73a1d77ec187..3091e4bc04ef 100644
> > --- a/fs/xfs/xfs_qm_bhv.c
> > +++ b/fs/xfs/xfs_qm_bhv.c
> > @@ -40,7 +40,7 @@ xfs_fill_statvfs_from_dquot(
> >                 statp->f_files = limit;
> >                 statp->f_ffree =
> >                         (statp->f_files > dqp->q_res_icount) ?
> > -                        (statp->f_ffree - dqp->q_res_icount) : 0;
> > +                        (statp->f_files - dqp->q_res_icount) : 0;
> >         }
> >  }
> >
> > --
> > 2.16.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-23  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 13:28 [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set dbyin(尹烨)
2018-11-22 17:58 ` Darrick J. Wong
2018-11-23  2:10   ` 答复: [PATCH] fs/xfs: fix f_ffree value for statfs when project quota is set(Internet mail) dbyin(尹烨)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.