LU-4249 quota: race in qsd_upd_thread()

qsd_upd_thread() uses list_for_each_entry_safe() to process
list items one by one, however, it has to drop lock while
processing each item, that'll race with other list processing
thread.

The proper way is to check list head each time when it acquired
lock.

Lustre-commit: f8f7c34a7bbcf22aeca7699ce76254e41e3e95b7
Lustre-change: http://review.whamcloud.com/10988

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I83e665db4209d52c1358505125abdcba75a0a6fa
Reviewed-on: http://review.whamcloud.com/11020
Tested-by: Jenkins
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4308 llite: protect file write and page_mkwrite race

Normal file write also need to grab a read semaphore of lli_trunc_sem
so that it would not race against ll_page_mkwrite.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I6cc2980b9e67e48bfb132296cf6c36ae69d4c153
Reviewed-on: http://review.whamcloud.com/11098
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>