gluster / glusterfs

Gluster Filesystem : Build your distributed storage in minutes
https://www.gluster.org
GNU General Public License v2.0
4.71k stars 1.08k forks source link

posix: In small storage environment posix xlator does not respects storage.reserve value #3636

Open mohit84 opened 2 years ago

mohit84 commented 2 years ago

In a small storage environment (brick_root is < 100G) the POSIX xlator does not respects storage.reserve value. The flag value is set after every 5s basis and so if in that time period the client has generated the data the posix xlator does not validate storage. reserve spae check allow consuming the brick unless the flag has not been set by a posixctxres thread.

Solution: Before doing any writev for an external client check the current free storage space with writev buffer and if it has surpassed the limit return ENOSPC. The priv->write_value flag has been updated during call unlink and truncate fop also to use the correct value.

mohit84 commented 2 years ago

To reproduce it run a test case tests/bugs/posix/bug-1651445.t without using sleep 5s value in .t