Menu

Possible to exceed quota with NFS

Help
2006-05-23
2013-03-26
  • Johan Sundin

    Johan Sundin - 2006-05-23

    Hello,

    I'm having the same problem as a previous poster, namely that quota is not enforced over NFS. I have not found a solution anywhere else, so here goes..

    My setup is as follows:

    - Server: Debian Sarge, nfs-kernel-server, rpc.rquotad, ext3 w/usrquota on lvm + raid5, Kernel 2.6.8

    - Clients: Debian Sarge, nfs-common, Kernel 2.6.8 and 2.4.27

    Now, if I attempt to exceed my quota when logged in to the server, it promptly thwarts my attempts.
    However, if I attempt to exceed my quota when logged in to the client, nothing happens.

    Client Example:

    testq@client2:/home/users/testq$ dd if=/dev/zero of=bigfile bs=1048576 count=100
    100+0 records in
    100+0 records out
    104857600 bytes transferred in 5.217879 seconds (20095828 bytes/sec)
    testq@client2:/home/users/testq$ quota -v
    Disk quotas for user testq (uid 14364):
         Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
    server:/storage/users
                     102740*  46080   51200              45       0       0

    Clearly over both hard and soft limits.

    Server example:
    testq@server:/storage/users/testq$ dd if=/dev/zero of=bigfile bs=1048576 count=100
    dm-3: warning, user block quota exceeded.
    dm-3: write failed, user block limit reached.
                                                                                          dd: writing `bigfile': Disk quota exceeded
    50+0 records in
    49+0 records out
    52129792 bytes transferred in 0.159503 seconds (326826567 bytes/sec)
    testq@server:/storage/users/testq$ quota -v
    Disk quotas for user testq (uid 14364):
         Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
    /dev/mapper/vol00-users
                      51200*  46080   51200              45       0       0

    I'm not convinced this is actually a problem with quota, but I figured it would be a good place to start.

     
    • Jan Kara

      Jan Kara - 2006-05-23

      The problem is probably in the nfs server code. Quotas over NFS are enforced on a server (a client simply sends a write and waits what the server will do with it). What probably happens is that NFS server - obviously running as root - writes data as root and hence it can exceed limits arbitrarily. It should either perform the write on behalf of the user or check whether it is not exceeding quotas... What remains secret to me is why you see the problem and others don't.

       

Log in to post a comment.

MongoDB Logo MongoDB