The timeout feature is added to "freeze ioctl" to solve a deadlockwhen the freezer accesses a frozen filesystem. And new ioctlto reset the timeout period is added to extend the timeout period.For example, the freezer resets the timeout period to 10 seconds every 5seconds. In this approach, even if the freezer causes a deadlock byaccessing the frozen filesystem, it will be solved by the timeoutin 10 seconds and the freezer will be able to recognize thatat the next reset of timeout period.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.

/** * 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. * The reference counter (bd_fsfreeze_count) guarantees that only the last * unfreeze process can unfreeze the frozen filesystem actually when multiple * freeze requests arrive simultaneously. It counts up in freeze_bdev() and * count down in thaw_bdev(). When it becomes 0, thaw_bdev() will unfreeze * actually. */-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; int error = 0;