FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 09-22-2008, 10:57 AM
Takashi Sato
 
Default gfs2: Fix error handling in write_super_lockfs/unlockfs

I've changed write_super_lockfs/unlockfs so that they always return
0 (success) to keep a current behavior.

Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
---
ops_super.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff -uprN -X linux-2.6.27-rc7-lockfs-ext4/Documentation/dontdiff linux-2.6.27-rc7-lockfs-ext4/fs/gfs2/ops_super.c linux
-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c
--- linux-2.6.27-rc7-lockfs-ext4/fs/gfs2/ops_super.c 2008-09-22 07:29:55.000000000 +0900
+++ linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c 2008-09-22 10:52:16.000000000 +0900
@@ -166,13 +166,13 @@ static int gfs2_sync_fs(struct super_blo
*
*/

-static void gfs2_write_super_lockfs(struct super_block *sb)
+static int gfs2_write_super_lockfs(struct super_block *sb)
{
struct gfs2_sbd *sdp = sb->s_fs_info;
int error;

if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
- return;
+ return 0;

for (; {
error = gfs2_freeze_fs(sdp);
@@ -192,6 +192,7 @@ static void gfs2_write_super_lockfs(stru
fs_err(sdp, "retrying...
");
msleep(1000);
}
+ return 0;
}

/**
@@ -200,9 +201,10 @@ static void gfs2_write_super_lockfs(stru
*
*/

-static void gfs2_unlockfs(struct super_block *sb)
+static int gfs2_unlockfs(struct super_block *sb)
{
gfs2_unfreeze_fs(sb->s_fs_info);
+ return 0;
}

/**

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 09-22-2008, 11:23 AM
 
Default gfs2: Fix error handling in write_super_lockfs/unlockfs

Hi,

On Mon, Sep 22, 2008 at 07:57:18PM +0900, Takashi Sato wrote:
> I've changed write_super_lockfs/unlockfs so that they always return
> 0 (success) to keep a current behavior.
>
> Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
> Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
> ---
> ops_super.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff -uprN -X linux-2.6.27-rc7-lockfs-ext4/Documentation/dontdiff linux-2.6.27-rc7-lockfs-ext4/fs/gfs2/ops_super.c linux
> -2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c
> --- linux-2.6.27-rc7-lockfs-ext4/fs/gfs2/ops_super.c 2008-09-22 07:29:55.000000000 +0900
> +++ linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c 2008-09-22 10:52:16.000000000 +0900
> @@ -166,13 +166,13 @@ static int gfs2_sync_fs(struct super_blo
> *
> */
>
> -static void gfs2_write_super_lockfs(struct super_block *sb)
> +static int gfs2_write_super_lockfs(struct super_block *sb)
> {
> struct gfs2_sbd *sdp = sb->s_fs_info;
> int error;
>
> if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
> - return;
> + return 0;
>
Since this now returns a status, then this should indicate a failure
I think. Perhaps -EINVAL would be suitable?

Otherwise it looks good from a gfs2 perspective,

Steve.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 09-26-2008, 08:58 AM
Takashi Sato
 
Default gfs2: Fix error handling in write_super_lockfs/unlockfs

Changed write_super_lockfs so that it returns an error in case of an failure.
unlockfs always returns 0.

Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
---
ops_super.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff -uprN -X linux-2.6.27-rc7-lockfs-reiserfs/Documentation/dontdiff linux-2.6.27-rc7-lockfs-reiserfs/fs/gfs2/ops_super
.c linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c
--- linux-2.6.27-rc7-lockfs-reiserfs/fs/gfs2/ops_super.c 2008-09-26 12:24:01.000000000 +0900
+++ linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c 2008-09-26 17:02:06.000000000 +0900
@@ -161,18 +161,18 @@ static int gfs2_sync_fs(struct super_blo
}

/**
- * gfs2_write_super_lockfs - prevent further writes to the filesystem
+ * gfs2_freeze - prevent further writes to the filesystem
* @sb: the VFS structure for the filesystem
*
*/

-static void gfs2_write_super_lockfs(struct super_block *sb)
+static int gfs2_freeze(struct super_block *sb)
{
struct gfs2_sbd *sdp = sb->s_fs_info;
int error;

if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
- return;
+ return -EINVAL;

for (; {
error = gfs2_freeze_fs(sdp);
@@ -192,17 +192,19 @@ static void gfs2_write_super_lockfs(stru
fs_err(sdp, "retrying...
");
msleep(1000);
}
+ return 0;
}

/**
- * gfs2_unlockfs - reallow writes to the filesystem
+ * gfs2_unfreeze - reallow writes to the filesystem
* @sb: the VFS structure for the filesystem
*
*/

-static void gfs2_unlockfs(struct super_block *sb)
+static int gfs2_unfreeze(struct super_block *sb)
{
gfs2_unfreeze_fs(sb->s_fs_info);
+ return 0;
}

/**
@@ -505,8 +507,8 @@ const struct super_operations gfs2_super
.put_super = gfs2_put_super,
.write_super = gfs2_write_super,
.sync_fs = gfs2_sync_fs,
- .write_super_lockfs = gfs2_write_super_lockfs,
- .unlockfs = gfs2_unlockfs,
+ .freeze_fs = gfs2_freeze,
+ .unfreeze_fs = gfs2_unfreeze,
.statfs = gfs2_statfs,
.remount_fs = gfs2_remount_fs,
.clear_inode = gfs2_clear_inode,

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 09-26-2008, 09:37 AM
 
Default gfs2: Fix error handling in write_super_lockfs/unlockfs

Hi,

On Fri, Sep 26, 2008 at 05:58:21PM +0900, Takashi Sato wrote:
> Changed write_super_lockfs so that it returns an error in case of an failure.
> unlockfs always returns 0.

Looks good now. Thanks,

Steve.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 09:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org