• Andrew Morton's avatar
    [PATCH] quota locking update · b0de9c76
    Andrew Morton authored
    I've been carrying this since Jan sent it out a month or two ago.
    I don't know if anyone has tested it though.  The sort of people
    who use quotas tend to like nice stable kernels.  I read through it,
    but can't say that I know enough about quotas to know if it makes sense.
    The wait_on_dquot() synchronisation is a bit odd.
    
    I do need to do a round of stability testing with this and ext3 - the
    interaction between quotas and ext3 is an area where we've had deadlocks
    in the past.
    
    But the quota locking is definitely looking crufty, and I'd suggest that
    we run with this..
    
    
    Patch from Jan Kara <jack@suse.cz>
    
    "I'm resending you the patch with new quota SMP locking.  The patch removes
     BKL and replaces it with two spinlocks protecting quota lists and data
     stored in dquot structures.  Also non-SMP locking was changed a bit make SMP
     locking easier (eg.  we got rid of not very nice dq_dup_ref counters).  The
     patch is against 2.5.48 but applies well also to 2.5.49.  Would you please
     apply the patch?"
    
    
    - Change dqoff_sem from a semaphore to an rwsem.
    
    - Convert dqi_flags from an int to a ulong and use test_bit/set_bit rather
      thatn &/|
    
    - The various exported quota operations now run without lock_kernel().
      This means that things like DQUOT_ALLOC_SPACE no longer take lock_kernel()
      in out high-perfomance filesystems.  Nice.
    
    - Replace lock_kernel() in the quota code with two quota-private global
      locks.
    
    - Replace all the open-coded waitqueue management with a semaphore
      (wait_on_dquot())
    b0de9c76
dquot.c 38.8 KB