Re: [PATCH 03/39] ocfs2: throttle back local alloc when low on disk space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Wed, 24 Sep 2008 15:00:44 -0700 Mark Fasheh <mfasheh@xxxxxxxx> wrote:
> +void ocfs2_local_alloc_seen_free_bits(struct ocfs2_super *osb,
> +				      unsigned int num_clusters)
> +{
> +	spin_lock(&osb->osb_lock);
> +	if (osb->local_alloc_state == OCFS2_LA_DISABLED ||
> +	    osb->local_alloc_state == OCFS2_LA_THROTTLED)
> +		if (num_clusters >= osb->local_alloc_default_bits) {
> +			cancel_delayed_work(&osb->la_enable_wq);
> +			osb->local_alloc_state = OCFS2_LA_ENABLED;
> +		}
> +	spin_unlock(&osb->osb_lock);
> +}
> +
> +void ocfs2_la_enable_worker(struct work_struct *work)
> +{
> +	struct ocfs2_super *osb =
> +		container_of(work, struct ocfs2_super,
> +			     la_enable_wq.work);
> +	spin_lock(&osb->osb_lock);
> +	osb->local_alloc_state = OCFS2_LA_ENABLED;
> +	spin_unlock(&osb->osb_lock);
> +}

cacnel_delayed_work() is a pretty risky function.  The work handler
(ocfs2_la_enable_worker) can execute an arbitrarily long time after
cancel_delayed_work() has returned.  Can all the code here cope with such a
surprise alteration of ->local_alloc_state()?

And you canot use cancel_delayed_work_sync() here due to a deadlock on
->osb_lock().

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux