Re: [PATCH 1/3] Implement generic freeze feature

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Takashi Sato
Date: Friday, August 29, 2008 - 2:36 am

Hi,

Andrew Morton wrote:

As Andreas said, we need to use 'X' to keep compatibility with
XFS's freeze ioctl.


bd_freeze_sem protects the following two sequences.
1. freeze_bdev()
  - Test of bd_freeze_count
  - Increment of bd_freeze_count
  - s_op->write_super_lockfs
  - Set unfreeze timer

2. thaw_bdev()
  - Test of bd_freeze_count
  - Decrement of bd_freeze_count
  - s_op->unlockfs
  - Unset unfreeze timer
Because the journal sync in ext3's write_super_lockfs might
need a long time, we should use the mutex (not atomic_t).
If bd_freeze_sem protects only the modification and
testing of bd_freeze_count, freeze_bdev() and thaw_bdev() will
run simultaneously and unexpected problem will occur. 
(For example, after we run the freeze ioctl with timeout period,
the filesystem is frozen, but the unfreeze timer isn't set.)

Cheers, Takashi
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] Implement generic freeze feature, Takashi Sato, (Mon Aug 18, 5:28 am)
Re: [PATCH 1/3] Implement generic freeze feature, Andrew Morton, (Thu Aug 21, 12:58 pm)
Re: [PATCH 1/3] Implement generic freeze feature, Andreas Dilger, (Fri Aug 22, 12:09 am)
Re: [PATCH 1/3] Implement generic freeze feature, Christoph Hellwig, (Fri Aug 22, 11:14 am)
Re: [PATCH 1/3] Implement generic freeze feature, Takashi Sato, (Fri Aug 29, 2:36 am)
Re: [PATCH 1/3] Implement generic freeze feature, Takashi Sato, (Fri Aug 29, 2:37 am)
Re: [PATCH 1/3] Implement generic freeze feature, Eric Sandeen, (Thu Sep 4, 9:55 am)
Re: [PATCH 1/3] Implement generic freeze feature, Takashi Sato, (Thu Sep 11, 3:58 am)