The atomic_read() allowing the atomic_inc() are not covered
by a lock. Thus they may safely race and trip this CERROR()
unless we add in a small fudge factor (+1).
i=adilger
i=dmitry.zogin
CERROR("dirty %lu > dirty_max %lu\n",
cli->cl_dirty, cli->cl_dirty_max);
oa->o_undirty = 0;
- } else if (atomic_read(&obd_dirty_pages) > obd_max_dirty_pages) {
+ } else if (atomic_read(&obd_dirty_pages) > obd_max_dirty_pages + 1) {
+ /* The atomic_read() allowing the atomic_inc() are not covered
+ * by a lock thus they may safely race and trip this CERROR()
+ * unless we add in a small fudge factor (+1). */
CERROR("dirty %d > system dirty_max %d\n",
atomic_read(&obd_dirty_pages), obd_max_dirty_pages);
oa->o_undirty = 0;