--- - branch: MAIN date: Thu Sep 27 07:47:57 UTC 2012 files: - new: '1.35' old: '1.34' path: src/sys/ufs/ufs/ufs_quota2.c pathrev: src/sys/ufs/ufs/ufs_quota2.c@1.35 type: modified id: 20120927T074757Z.4a129858700d5deeff841268e149fa323ece2bb4 log: | Fix quota2 list corruption issue when defaultquotas are 0 (deny any file and block allocation). When quota2_check() is called with an uid not yet in the list, getinoquota2() will call quota2_q2ealloc() to allocate a new entry for this uid. quota2_q2ealloc() will remove an entry from the free list and put it at the head of the corresponding hash list, and flush the block containing the header if it's not the one also containing the allocated entry. quota2_q2ealloc() then return the alocated entry and corresponding block to caller (getinoquota2() here), which returns it to quota2_check(). quota2_check() then checks if the allocation can succeed, and returns and error if not and calls brelse() on the buffer (because from his POW no change was made to the entry), effectively discarding changes to the entry that may have been made by quota2_q2ealloc(). Fix by always bwrite()ing the entry in quota2_q2ealloc(), and re-reading the entry in caller. module: src subject: 'CVS commit: src/sys/ufs/ufs' unixtime: '1348732077' user: bouyer