All of lore.kernel.org
 help / color / mirror / Atom feed
* information of statfs
@ 2018-01-10  6:17 Chengguang Xu
  2018-01-10  8:08 ` Amir Goldstein
  0 siblings, 1 reply; 3+ messages in thread
From: Chengguang Xu @ 2018-01-10  6:17 UTC (permalink / raw)
  To: overlayfs

Hello,

This is just my suggestion, in ovl_statfs() isn’t it better to set
below fields(indicating available free resource) to zero when overlayfs
doesn’t have upper fs?Because overlayfs can not occupy resource in
lower stack fs anymore, I think it can reduce the possibility of
misunderstanding from caller.

u64 f_bfree  /* free blocks in fs */
u64 f_bavail /* free blocks available to unprivileged user */
u64 f_ffree  /* free file nodes in fs */


Thanks,
Chengguang.

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

* Re: information of statfs
  2018-01-10  6:17 information of statfs Chengguang Xu
@ 2018-01-10  8:08 ` Amir Goldstein
  2018-01-10  8:47   ` Chengguang Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2018-01-10  8:08 UTC (permalink / raw)
  To: Chengguang Xu; +Cc: overlayfs

On Wed, Jan 10, 2018 at 8:17 AM, Chengguang Xu <cgxu519@icloud.com> wrote:
> Hello,
>
> This is just my suggestion, in ovl_statfs() isn’t it better to set
> below fields(indicating available free resource) to zero when overlayfs
> doesn’t have upper fs?Because overlayfs can not occupy resource in
> lower stack fs anymore, I think it can reduce the possibility of
> misunderstanding from caller.
>

I see the logic in your proposal, but I don't think that behavior is consistent
w.r.t other fs that are mounted readonly.
In what way is an overlay mount with no upper different than any fs that
is mounted readonly?
statfs from a readonly fs returns non-zero free blocks even though write is
not possible.
The user gets a different error when trying to write (EROFS) and not
ENOSPC, so where do you see a chance of misunderstanding from caller?

Thanks,
Amir.

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

* Re: information of statfs
  2018-01-10  8:08 ` Amir Goldstein
@ 2018-01-10  8:47   ` Chengguang Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Chengguang Xu @ 2018-01-10  8:47 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: overlayfs

> 
> 在 2018年1月10日,下午4:08,Amir Goldstein <amir73il@gmail.com> 写道:
> 
> On Wed, Jan 10, 2018 at 8:17 AM, Chengguang Xu <cgxu519@icloud.com> wrote:
>> Hello,
>> 
>> This is just my suggestion, in ovl_statfs() isn’t it better to set
>> below fields(indicating available free resource) to zero when overlayfs
>> doesn’t have upper fs?Because overlayfs can not occupy resource in
>> lower stack fs anymore, I think it can reduce the possibility of
>> misunderstanding from caller.
>> 
> 
> I see the logic in your proposal, but I don't think that behavior is consistent
> w.r.t other fs that are mounted readonly.
> In what way is an overlay mount with no upper different than any fs that
> is mounted readonly?

I think there is nothing different and actually it's our expectation.

> statfs from a readonly fs returns non-zero free blocks even though write is
> not possible.

Yes, that’s right, free blocks do not have direct connection with write
permission in this case. I’m more willing to talk in the point of view
of ownership than write ability.


> The user gets a different error when trying to write (EROFS) and not
> ENOSPC, so where do you see a chance of misunderstanding from caller?

I don’t hope to change write error code as I mentioned above.



Thanks,
Chengguang.

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

end of thread, other threads:[~2018-01-10  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10  6:17 information of statfs Chengguang Xu
2018-01-10  8:08 ` Amir Goldstein
2018-01-10  8:47   ` Chengguang Xu

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.