|
|

07-09-2008, 02:13 PM
|
|
|
Add timeout feature
Oops..
> WHY A TIMEOUT - need a way for operator to abort the
> freeze
instead of "abort" I should have said "limit" because
it is really proactive control (so they will not get
called in the middle of the night by pissed users).
I forgot to make it clear that TIMEOUT is the same as AUTO-THAW
in logging errors so the adnin knows they have a bad snapshot and
can do it again.
I also forgot to say that our customers all say they can deal
with retrying a snapshot, but not with unknown bad snapshots
and most definitely not with killing their 24/7 operations!
jim
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-09-2008, 08:44 PM
|
|
|
Add timeout feature
Hi!
> > > > > I still disagree with this whole patch. There is not reason to let
> > > > > the freeze request timeout - an auto-unfreezing will only confuse the
> > > > > hell out of the caller. The only reason where the current XFS freeze
> > > > > call can hang and this would be theoretically useful is when the
> > > >
> > > > What happens when someone dirties so much data that vm swaps out
> > > > whatever process that frozen the filesystem?
> > >
> > > a) you can't dirty a frozen filesystem - by definition a frozen
> > > filesystem is a *clean filesystem* and *cannot be dirtied*.
> >
> > Can you stop me?
> >
> > mmap("/some/huge_file", MAP_SHARED);
> >
> > then write to memory mapping?
>
> Sure - we can put a hook in ->page_mkwrite() to prevent it. We
> don't right now because nobody in the real world really cares if one
> half of a concurrent user data change is in the old snapshot or the
> new one......
>
> > > b) Swap doesn't write through the filesystem
> > > c) you can still read from a frozen filesystem to page your
> > > executable?? in.
> >
> > atime modification should mean dirty data, right?
>
> Metadata, not data. If that's really a problem (and it never has
> been for XFS because we always allow in memory changes to atime)
> then touch_atime could be easily changed to avoid this...
>
> > And dirty data mean
> > memory pressure, right?
>
> If you walk enough inodes while the filesystem is frozen, it
> theoretically could happen. Typically a filesystem is only for a
> few seconds at a time so in the real world this has never, ever been
> a problem.
So we have freezing interface that does not really freeze, and
that can break the system when filesystem is frozen for too long...
:-(.
Maybe you could use process freezer -- cgroup people are adding
userspace interface to that -- to solve those... but that would mean
stopping everyone but thread doing freezing...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-09-2008, 08:48 PM
|
|
|
Add timeout feature
On Wed 2008-07-09 09:08:07, Miklos Szeredi wrote:
> On Tue, 8 Jul 2008, Arjan van de Ven wrote:
> > I tihnk the idea there is
> >
> > freeze . do the snapshot op . unfreeze . make backup of snapshot
>
> Ah, so then my proposal would become
>
> run_frozen mountpoint do-snapshot
> do-backup
> release-snapshot
>
> and if they are afraid of deadlocks they can just implement the
> timeout in userspace:
>
> run_frozen -t timeout mountpoint do-snapshot
>
> 'run_frozen' can be a trivial 30 line app, that can be guaranteed not
> to deadlock.
Userland apps can be swapped out and need kernel memory allocations
during syscalls.
I bet even sleep(30) uses kmalloc internally.
So yes, even trivial applications can deadlock.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-13-2008, 12:06 PM
|
|
|
Add timeout feature
Hi!
> NEED - provide way for SAN and hardware raid storage to do
> its snapshot/copy function while the system was in-use and
> get an image that could mount cleanly. Without freeze, at
> a minimum we usually needed filesystem metadata recovery
> to run, worst case is completely unusable snapshits 
>
> freezefs() is single-level:
>
> ENOTSUPPOTED - by any other fs
> EOK - done
> EINPROGRESS
> EALREADY
>
> As implemented, freezefs only ensures the metadata is
> consistent so the filesystem copy can mount anywhere.
>
> This means ONLY SOME metadata (or no metadata) is flushed and
> then all metadata updates are stopped. User/kernel writes
> to already allocated file pages WILL go to a frozen disk.
That's the difference here. They do write file data, and thus avoid
mmap()-writes problem.
...and they _still_ provide auto-thaw.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-13-2008, 05:15 PM
|
|
|
Add timeout feature
Pavel Machek wrote:
This means ONLY SOME metadata (or no metadata) is flushed and
then all metadata updates are stopped. User/kernel writes
to already allocated file pages WILL go to a frozen disk.
That's the difference here. They do write file data, and thus avoid
mmap()-writes problem.
...and they _still_ provide auto-thaw.
Pavel
One of the hardest things to make people understand is that
stopping file data writes in the filesystem during a freeze
is not just dangerous, it is also __worthless__ unless you
have a complete "user environment freeze" mechanism.
In a real 24/7 environment, the DB and application stack
may be poorly glued together stuff from multiple vendors.
And unless each independent component has a freeze and they
can all be coordinated, the data in the pipeline is never
stable enough to say "if you stop all writes to disk and
take a snapshot, this is the same as an orderly shutdown,
backup, restore, and startup".
If you need to stop applications before a freeze, there
is no reason to implement "stop writing file data to disk".
The only real way to make it work (and what the smart apps
do) is to have application "checkpoint" commands so they
can roll-back to a stable point from the snapshot while
allowing new user activity to proceed.
People who don't have checkpoints or some other way to
make their environment stable with a transitioning snapshot
must stop all user activity before snapshotting and have
maintenance windows defined to do that.
jim
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-14-2008, 06:36 AM
|
|
|
Add timeout feature
On Sun 2008-07-13 13:15:43, jim owens wrote:
> Pavel Machek wrote:
>
>>> This means ONLY SOME metadata (or no metadata) is flushed and
>>> then all metadata updates are stopped. User/kernel writes
>>> to already allocated file pages WILL go to a frozen disk.
>>
>> That's the difference here. They do write file data, and thus avoid
>> mmap()-writes problem.
>>
>> ...and they _still_ provide auto-thaw.
>> Pavel
>
> One of the hardest things to make people understand is that
> stopping file data writes in the filesystem during a freeze
> is not just dangerous, it is also __worthless__ unless you
> have a complete "user environment freeze" mechanism.
Eh?
> And unless each independent component has a freeze and they
> can all be coordinated, the data in the pipeline is never
> stable enough to say "if you stop all writes to disk and
> take a snapshot, this is the same as an orderly shutdown,
> backup, restore, and startup".
If you also freeze data writes, at least snapshot is not worse than
_unexpected_ shutdown.
And apps should already be ready for unexpected shutdowns (using fsync
etc).
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-14-2008, 01:12 PM
|
|
|
Add timeout feature
Hi,
jim owens wrote:
In addition to the user controllable timeout mechanism,
we internally implement AUTO-THAW in the filesystem
whenever necessary to prevent a kernel hang/crash.
If an AUTO-THAW occurs, we post to the log and an
event manager so the user knows the snapshot is bad.
I am interested in AUTO-THAW.
What is the difference between the timeout and AUTO-THAW?
When the kernel detects a deadlock, does it occur to solve it?
Cheers, Takashi
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-14-2008, 01:17 PM
|
|
|
Add timeout feature
Pavel Machek wrote:
If you also freeze data writes, at least snapshot is not worse than
_unexpected_ shutdown.
True. But the key point is also that stopping file writes is
__no better__ than an unexpected shutdown for applications.
Once kernel people accept that it is identical to an unknown
shutdown state, they realize that as you said...
And apps should already be ready for unexpected shutdowns (using fsync
etc).
The people writing the code outside the kernel are the ones
responsible for the logic of handling "we don't know what
application writes made it to disk".
Remember that immediately after fsync(), the next write
can make the file inconsistent. For example, look at this
simple sales processing database type sequence:
write(sale_last_name_file, "Mackek"
write(sale_first_name_file, "Pavel")
fsync(sale_last_name_file)
fsync(sale_first_name_file)
...
write(sale_last_name_file, "Owens")
write(sale_first_name_file, "Jim")
fsync(sale_last_name_file)
FREEZEFS [defined to NOT allow file data writes]
So if we restart from that snapshot, the sales order
thinks the customer is "Pavel Owens"... unless there
is some mechanism such as seqence numbers that tie
the files together. And if they have such a mechanism
then it doesn't matter if we allow even more writes
such as:
write(sale_first_name_file, "Ted")
There just is no way inside the kernel to know a
freeze was triggered at a stable application point
such that data before the freeze must be on disk
and data after the freez must not go to disk.
This issue is not unique to freeze, it is also
present with filesystems that have snapshots and
cow/versioning built in.
jim
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-14-2008, 02:04 PM
|
|
|
Add timeout feature
Takashi Sato wrote:
What is the difference between the timeout and AUTO-THAW?
When the kernel detects a deadlock, does it occur to solve it?
TIMEOUT is a user-specified limit for the freeze. It is
not a deadlock preventer or deadlock breaker. The reason
it exists is:
- middle of the night (low but not zero users)
- cron triggers freeze and hardware snapshot
- san is overloaded by tape copy traffic so
hardware will take 2 hours to ack snapshot done
- user "company president" tries to create a report
needed for an AM meeting with bankers
- with so few users, system will just patiently
wait for hardware to finish
- after 10 minutes "company president" pages
admin, admin's boss, and "IT vice president"
in a real unhappy mood
AUTO-THAW is simply a name for the effect of all deadlock
preventer and deadlock breaker code that the kernel has
in the freeze implementation paths... if that code would
unfreeze the filesystem. We also implemented deadlock
preventer code that does not thaw the freeze.
None of the AUTO-THAW code is there to stop a stupid
userspace program caller of freeze. It handles things
like "a system in our cluster is going down so we
must have this filesystem unfrozen or the whole
cluster will crash". In places where there could be
a kernel deadlock we made it "lock-only-if-non-blocking"
and if we could not wait to retry later, the failure
to lock would trigger an immediate unfreeze.
Deadlock prevention needs code in critical paths in more
than just filesystems. Sometimes this is as simple as
an "I can't wait on freeze" flag added to a vm-filesystem
interface.
Timers just don't work for keeping the kernel alive
because they don't trigger on resource exhaustion.
jim
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|

07-22-2008, 09:36 AM
|
|
|
Add timeout feature
The timeout feature is added to freeze ioctl. And new ioctl
to reset the timeout period is added.
o Freeze the filesystem
int ioctl(int fd, int FIFREEZE, long *timeout_sec)
fd: The file descriptor of the mountpoint
FIFREEZE: request code for the freeze
timeout_sec: the timeout period in seconds
If it's 0 or 1, the timeout isn't set.
This special case of "1" is implemented to keep
the compatibility with XFS applications.
Return value: 0 if the operation succeeds. Otherwise, -1
o Reset the timeout period
int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec)
fd:file descriptor of mountpoint
FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period
timeout_sec: new timeout period in seconds
Return value: 0 if the operation succeeds. Otherwise, -1
Error number: If the filesystem has already been unfrozen,
errno is set to EINVAL.
Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
---
drivers/md/dm.c | 2 -
fs/block_dev.c | 2 +
fs/buffer.c | 16 +++++++--
fs/ioctl.c | 77 ++++++++++++++++++++++++++++++++++++++++++--
fs/super.c | 57 ++++++++++++++++++++++++++++++++
fs/xfs/xfs_fsops.c | 2 -
include/linux/buffer_head.h | 3 +
include/linux/fs.h | 10 +++++
8 files changed, 160 insertions(+), 9 deletions(-)
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/drivers/md/dm.c linux-2.6.26-timeout/drivers/md/d
m.c
--- linux-2.6.26-xfs/drivers/md/dm.c 2008-07-17 11:33:03.000000000 +0900
+++ linux-2.6.26-timeout/drivers/md/dm.c 2008-07-17 11:36:00.000000000 +0900
@@ -1407,7 +1407,7 @@ static int lock_fs(struct mapped_device
WARN_ON(md->frozen_sb);
- md->frozen_sb = freeze_bdev(md->suspended_bdev);
+ md->frozen_sb = freeze_bdev(md->suspended_bdev, 0);
if (IS_ERR(md->frozen_sb)) {
r = PTR_ERR(md->frozen_sb);
md->frozen_sb = NULL;
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/block_dev.c linux-2.6.26-timeout/fs/block_dev.
c
--- linux-2.6.26-xfs/fs/block_dev.c 2008-07-18 15:53:51.000000000 +0900
+++ linux-2.6.26-timeout/fs/block_dev.c 2008-07-18 17:12:22.000000000 +0900
@@ -287,6 +287,8 @@ static void init_once(struct kmem_cache
inode_init_once(&ei->vfs_inode);
/* Initialize semaphore for freeze. */
sema_init(&bdev->bd_freeze_sem, 1);
+ /* Setup freeze timeout function. */
+ INIT_DELAYED_WORK(&bdev->bd_freeze_timeout, freeze_timeout);
}
static inline void __bd_forget(struct inode *inode)
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/buffer.c linux-2.6.26-timeout/fs/buffer.c
--- linux-2.6.26-xfs/fs/buffer.c 2008-07-18 15:53:51.000000000 +0900
+++ linux-2.6.26-timeout/fs/buffer.c 2008-07-18 17:17:50.000000000 +0900
@@ -190,14 +190,18 @@ int fsync_bdev(struct block_device *bdev
/**
* freeze_bdev -- lock a filesystem and force it into a consistent state
- * @bdev: blockdevice to lock
+ * @bdev: blockdevice to lock
+ * @timeout_msec: timeout period
*
* This takes the block device bd_mount_sem to make sure no new mounts
* happen on bdev until thaw_bdev() is called.
* If a superblock is found on this device, we take the s_umount semaphore
* on it to make sure nobody unmounts until the snapshot creation is done.
+ * If timeout_msec is bigger than 0, this registers the delayed work for
+ * timeout of the freeze feature.
*/
-struct super_block *freeze_bdev(struct block_device *bdev)
+struct super_block *freeze_bdev(struct block_device *bdev,
+ unsigned int timeout_msec)
{
struct super_block *sb;
@@ -228,8 +232,11 @@ struct super_block *freeze_bdev(struct b
}
sync_blockdev(bdev);
- up(&bdev->bd_freeze_sem);
+ /* Setup unfreeze timer. */
+ if (timeout_msec > 0)
+ add_freeze_timeout(bdev, timeout_msec);
+ up(&bdev->bd_freeze_sem);
return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */
}
EXPORT_SYMBOL(freeze_bdev);
@@ -255,6 +262,9 @@ int thaw_bdev(struct block_device *bdev,
return 0;
}
+ /* Delete unfreeze timer. */
+ del_freeze_timeout(bdev);
+
if (sb) {
BUG_ON(sb->s_bdev != bdev);
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/ioctl.c linux-2.6.26-timeout/fs/ioctl.c
--- linux-2.6.26-xfs/fs/ioctl.c 2008-07-18 21:57:20.000000000 +0900
+++ linux-2.6.26-timeout/fs/ioctl.c 2008-07-22 11:50:42.000000000 +0900
@@ -145,12 +145,16 @@ static int ioctl_fioasync(unsigned int f
* ioctl_freeze - Freeze the filesystem.
*
* @filp: target file
+ * @argp: timeout value(sec)
*
* Call freeze_bdev() to freeze the filesystem.
*/
-static int ioctl_freeze(struct file *filp)
+static int ioctl_freeze(struct file *filp, int __user *argp)
{
+ int timeout_sec;
+ unsigned int timeout_msec;
struct super_block *sb = filp->f_path.dentry->d_inode->i_sb;
+ int error;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -163,8 +167,25 @@ static int ioctl_freeze(struct file *fil
if (sb->s_bdev == NULL)
return -EINVAL;
+ /* arg(sec) to tick value. */
+ error = get_user(timeout_sec, argp);
+ if (error != 0)
+ return error;
+
+ if (timeout_sec < 0 || timeout_sec > UINT_MAX/1000)
+ return -EINVAL;
+
+ /*
+ * If 1 is specified as the timeout period it is changed into 0
+ * to retain compatibility with XFS's xfs_freeze.
+ */
+ if (timeout_sec == 1)
+ timeout_sec = 0;
+
+ timeout_msec = timeout_sec * 1000;
+
/* Freeze */
- sb = freeze_bdev(sb->s_bdev);
+ sb = freeze_bdev(sb->s_bdev, timeout_msec);
if (IS_ERR(sb))
return PTR_ERR(sb);
return 0;
@@ -193,6 +214,52 @@ static int ioctl_thaw(struct file *filp)
}
/*
+ * ioctl_freeze_reset_timeout - Reset timeout for freeze.
+ *
+ * @filp: target file
+ * @argp: timeout value(sec)
+ *
+ * Reset timeout for freeze.
+ */
+static int
+ioctl_freeze_reset_timeout(struct file *filp, int __user *argp)
+{
+ int timeout_sec;
+ unsigned int timeout_msec;
+ struct super_block *sb = filp->f_path.dentry->d_inode->i_sb;
+ struct block_device *bdev = sb->s_bdev;
+ int error;
+
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
+ /* If a regular file or a directory isn't specified, return EINVAL. */
+ if (bdev == NULL)
+ return -EINVAL;
+
+ /* arg(sec) to tick value */
+ error = get_user(timeout_sec, argp);
+ if (error)
+ return error;
+
+ if (timeout_sec <= 0 || timeout_sec > UINT_MAX/1000)
+ return -EINVAL;
+
+ timeout_msec = timeout_sec * 1000;
+
+ down(&bdev->bd_freeze_sem);
+ if (!bdev->bd_freeze_count) {
+ up(&bdev->bd_freeze_sem);
+ return -EINVAL;
+ }
+ /* setup unfreeze timer */
+ add_freeze_timeout(bdev, timeout_msec);
+ up(&bdev->bd_freeze_sem);
+
+ return 0;
+}
+
+/*
* When you add any new common ioctls to the switches above and below
* please update compat_sys_ioctl() too.
*
@@ -235,13 +302,17 @@ int do_vfs_ioctl(struct file *filp, unsi
break;
case FIFREEZE:
- error = ioctl_freeze(filp);
+ error = ioctl_freeze(filp, argp);
break;
case FITHAW:
error = ioctl_thaw(filp);
break;
+ case FIFREEZE_RESET_TIMEOUT:
+ error = ioctl_freeze_reset_timeout(filp, argp);
+ break;
+
default:
if (S_ISREG(filp->f_path.dentry->d_inode->i_mode))
error = file_ioctl(filp, cmd, arg);
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/super.c linux-2.6.26-timeout/fs/super.c
--- linux-2.6.26-xfs/fs/super.c 2008-07-17 11:33:13.000000000 +0900
+++ linux-2.6.26-timeout/fs/super.c 2008-07-17 11:36:00.000000000 +0900
@@ -980,3 +980,60 @@ struct vfsmount *kern_mount_data(struct
}
EXPORT_SYMBOL_GPL(kern_mount_data);
+
+/*
+ * freeze_timeout - Thaw the filesystem.
+ *
+ * @work: work queue (delayed_work.work)
+ *
+ * Called by the delayed work when elapsing the timeout period.
+ * Thaw the filesystem.
+ */
+void freeze_timeout(struct work_struct *work)
+{
+ struct block_device *bd = container_of(work,
+ struct block_device, bd_freeze_timeout.work);
+ struct super_block *sb = get_super(bd);
+
+ thaw_bdev(bd, sb);
+
+ if (sb)
+ drop_super(sb);
+}
+EXPORT_SYMBOL_GPL(freeze_timeout);
+
+/*
+ * add_freeze_timeout - Add timeout for freeze.
+ *
+ * @bdev: block device struct
+ * @timeout_msec: timeout period
+ *
+ * Add the delayed work for freeze timeout to the delayed work queue.
+ */
+void add_freeze_timeout(struct block_device *bdev, unsigned int timeout_msec)
+{
+ s64 timeout_jiffies = msecs_to_jiffies(timeout_msec);
+
+ /* Set delayed work queue */
+ cancel_delayed_work_sync(&bdev->bd_freeze_timeout);
+ schedule_delayed_work(&bdev->bd_freeze_timeout, timeout_jiffies);
+}
+
+/*
+ * del_freeze_timeout - Delete timeout for freeze.
+ *
+ * @bdev: block device struct
+ *
+ * Delete the delayed work for freeze timeout from the delayed work queue.
+ */
+void del_freeze_timeout(struct block_device *bdev)
+{
+ /*
+ * It's possible that the delayed work task (freeze_timeout()) calls
+ * del_freeze_timeout(). If the delayed work task calls
+ * cancel_delayed_work_sync((), the deadlock will occur.
+ * So we need this check (delayed_work_pending()).
+ */
+ if (delayed_work_pending(&bdev->bd_freeze_timeout))
+ cancel_delayed_work_sync(&bdev->bd_freeze_timeout);
+}
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/xfs/xfs_fsops.c linux-2.6.26-timeout/fs/xfs/xf
s_fsops.c
--- linux-2.6.26-xfs/fs/xfs/xfs_fsops.c 2008-07-17 11:33:13.000000000 +0900
+++ linux-2.6.26-timeout/fs/xfs/xfs_fsops.c 2008-07-17 11:36:00.000000000 +0900
@@ -619,7 +619,7 @@ xfs_fs_goingdown(
{
switch (inflags) {
case XFS_FSOP_GOING_FLAGS_DEFAULT: {
- struct super_block *sb = freeze_bdev(mp->m_super->s_bdev);
+ struct super_block *sb = freeze_bdev(mp->m_super->s_bdev, 0);
if (sb && !IS_ERR(sb)) {
xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/include/linux/buffer_head.h linux-2.6.26-timeout/
include/linux/buffer_head.h
--- linux-2.6.26-xfs/include/linux/buffer_head.h 2008-07-17 11:33:14.000000000 +0900
+++ linux-2.6.26-timeout/include/linux/buffer_head.h 2008-07-17 11:36:00.000000000 +0900
@@ -170,7 +170,8 @@ int sync_blockdev(struct block_device *b
void __wait_on_buffer(struct buffer_head *);
wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
int fsync_bdev(struct block_device *);
-struct super_block *freeze_bdev(struct block_device *);
+struct super_block *freeze_bdev(struct block_device *,
+ unsigned int timeout_msec);
int thaw_bdev(struct block_device *, struct super_block *);
int fsync_super(struct super_block *);
int fsync_no_super(struct block_device *);
diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/include/linux/fs.h linux-2.6.26-timeout/include/l
inux/fs.h
--- linux-2.6.26-xfs/include/linux/fs.h 2008-07-18 15:53:51.000000000 +0900
+++ linux-2.6.26-timeout/include/linux/fs.h 2008-07-18 21:51:41.000000000 +0900
@@ -8,6 +8,7 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
+#include <linux/workqueue.h>
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -226,6 +227,7 @@ extern int dir_notify_enable;
#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
#define FITHAW _IOWR('X', 120, int) /* Thaw */
+#define FIFREEZE_RESET_TIMEOUT _IO(0x00, 3) /* Reset freeze timeout */
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -550,10 +552,13 @@ struct block_device {
* care to not mess up bd_private for that case.
*/
unsigned long bd_private;
+
/* The counter of freeze processes */
int bd_freeze_count;
/* Semaphore for freeze */
struct semaphore bd_freeze_sem;
+ /* Delayed work for freeze */
+ struct delayed_work bd_freeze_timeout;
};
/*
@@ -2140,5 +2145,10 @@ int proc_nr_files(struct ctl_table *tabl
int get_filesystem_list(char * buf);
+extern void add_freeze_timeout(struct block_device *bdev,
+ unsigned int timeout_msec);
+extern void del_freeze_timeout(struct block_device *bdev);
+extern void freeze_timeout(struct work_struct *work);
+
#endif /* __KERNEL__ */
#endif /* _LINUX_FS_H */
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
|
|
|
All times are GMT. The time now is 08:56 AM.
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org
|