xfs
[Top] [All Lists]

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

To: "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH 2/3] Implement generic freeze feature
From: "Takashi Sato" <t-sato@xxxxxxxxxxxxx>
Date: Tue, 28 Oct 2008 21:33:59 +0900
Cc: "Christoph Hellwig" <hch@xxxxxxxxxxxxx>, <linux-fsdevel@xxxxxxxxxxxxxxx>, <dm-devel@xxxxxxxxxx>, <viro@xxxxxxxxxxxxxxxxxx>, <linux-ext4@xxxxxxxxxxxxxxx>, <xfs@xxxxxxxxxxx>, <mtk.manpages@xxxxxxxxxxxxxx>, <axboe@xxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
In-reply-to: <20081027231533.96c42a78.akpm@linux-foundation.org>
References: <20081027215855t-sato@mail.jp.nec.com> <20081027231533.96c42a78.akpm@linux-foundation.org>
Sender: xfs-bounce@xxxxxxxxxxx
Hi,

-void thaw_bdev(struct block_device *bdev, struct super_block *sb)
+int thaw_bdev(struct block_device *bdev, struct super_block *sb)
 {
+ int error = 0;
+
+ mutex_lock(&bdev->bd_fsfreeze_mutex);
+ if (!bdev->bd_fsfreeze_count) {
+ mutex_unlock(&bdev->bd_fsfreeze_mutex);
+ return -EINVAL;

This would be a programming error, yes?

This is not a kernel programming error but a user's. thaw_bdev() is called via the unfreeze ioctl. If a user calls the unfreeze ioctl for an unfrozen filesystem, this error will be returned. So a WARN_ON isn't needed.

If so, a WARN_ON is more appropriate than a silent runtime error.

+ }

Cheers, Takashi


<Prev in Thread] Current Thread [Next in Thread>