Quota issue on user belongs to multiple Group

I have setup a group quota for better disk usage.
What i am doing is to setup a quota with Samba share. I created user1,user2 and group project1 which belongs to /home/project1 dir. Quota is implemented on project1 group to write 100 MB on this share and This is working fine if a user1 and user2 which are belonging to project1 group under /home/project1. They can not write up to 100 MB on this share.

But the challenge is this when i am going to create another group project2 and created users user4 and user5 which belongs to this group and having home directory /home/project2 and samba share is created to access this.
This group is allocated 10 MB to write and user can't write up to 10 MB using samba share. Now the issue is when i assigned user4 to project1 as secondary group so they he can access/write on project1 share as well, he is accessing this share with only 10 MB limit where 100MB quota is assigned on this group.

My question is this, is there any way that a user which belongs to multi group [project1 and project2 and so on] he can write on these share as per the assigned quota on to these shares.

It looks as if the quota was set at partition level instead of directory level so that if belonging to 2 groups, each assigned to a specific directory, it takes the more restrictive rule (or the last one that has been setup ?)

Maybe you could have a look at chapter 4 and 5 of this

below are the steps what i did for this.

Scenario

group name : project1
group members : user1, user2, user3.
group dump folder/common folder to the above mention users : /home/project1 (/dev/sda2).
group disk quota limit : 100MB soft and 110MB hard limit

GROUP QUOTA

Step1 : Create a group
#groupadd project1

Step2 : Create all the require users with their home directory /home/project1 and group
as project1
#useradd -c "Testing group quota implementation" -m -d /home/project1 \
-g project1 user1
#useradd -c "Testing group quota implementation" -m -d /home/project1 \
-g project1 user2
#useradd -c "Testing group quota implementation" -m -d /home/project1 \
-g project1 user3

Step3 : Select/prepare the partition for quota, here my partition is /dev/sda2 so edit/etc/fstab file as shown below.
vim /etc/fstab
/dev/sda2 /home ext3 defaults,usrquota,grpquota 0 0

Step4 : Now remount the partition with rw permissions
#mount -o remount,rw /home

Step5 : Now create group quota database
#quotacheck -cug /home

Step6 : Once the above command executed successfully, check quota is implemented or not.
#repquota -a

Step 7 : #setquota -g project1 100000 110000 0 0 /dev/sda2
This will set quota for group project1

Step8 : #chmod 2770 -R /home/project1

Setup Samba Share

Step 1 : provide the permissions on the above created folder.
#chmod -R 775 project1
#chown -R user1: project1 project1

Step2 : Now open /etc/samba/smb.conf file to create a share
vim /etc/samba/smb.conf
[global]
wide links = yes
unix extensions = no
[project1]
comment = Project1 share with Quota
path = /home/project1
browsable = yes
writable = yes
valid users = @project1
create mask = 775
directory mask = 775

same i used to create group project2 and assigned user4 and user5 to this group and assigned quota on /home/project2 and make it share from samba.

Please let me know if i am missing some configuration for this scenario here.

Hello ctsgnb,

Thanks for the solution. I tried with Directory quota and this is working fine now.