From: Eric Sandeen <sandeen@sandeen.net>
To: Takashi Sato <t-sato@yk.jp.nec.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 4/10] xfs: Fix error handling in write_super_lockfs/unlockfs
Date: Thu, 25 Sep 2008 16:22:17 -0500 [thread overview]
Message-ID: <48DC0109.7070608@sandeen.net> (raw)
In-Reply-To: <20080922234120.GV5811@disturbed>
Dave Chinner wrote:
> xfs_fs_log_dummy() currently is void because it had nowhere to
> return errors to. It silently throws away errors because of this.
> Hence the correct thing to do here is to fix xfs_fs_log_dummy()
> to return the errors it currently ignores. i.e. catch the errors
> from xfs_trans_reserve() and xfs_trans_commit() calls in
> xfs_fs_log_dummy().
>
> Cheers,
>
> Dave.
>
Here's that part in case it's helpful :) Feel free to roll it into
your patch.
-Eric
Make xfs_fs_log_dummy() return errors which can then be returned by
xfs_fs_lockfs(), once it is capable of doing so.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
Index: linux-2.6/fs/xfs/xfs_fsops.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.c 2008-08-04 15:30:31.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.c 2008-09-25 16:16:46.916001110 -0500
@@ -589,17 +589,19 @@ out:
return 0;
}
-void
+int
xfs_fs_log_dummy(
xfs_mount_t *mp)
{
xfs_trans_t *tp;
xfs_inode_t *ip;
+ int error = 0;
tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1);
- if (xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0)) {
+ error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0);
+ if (error) {
xfs_trans_cancel(tp, 0);
- return;
+ return error;
}
ip = mp->m_rootip;
@@ -609,9 +611,10 @@ xfs_fs_log_dummy(
xfs_trans_ihold(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
- xfs_trans_commit(tp, 0);
+ error = xfs_trans_commit(tp, 0);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
+ return error;
}
int
Index: linux-2.6/fs/xfs/xfs_fsops.h
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.h 2008-06-05 13:44:24.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.h 2008-09-25 16:16:58.303000603 -0500
@@ -25,6 +25,6 @@ extern int xfs_fs_counts(xfs_mount_t *mp
extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
xfs_fsop_resblks_t *outval);
extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
-extern void xfs_fs_log_dummy(xfs_mount_t *mp);
+extern int xfs_fs_log_dummy(xfs_mount_t *mp);
#endif /* __XFS_FSOPS_H__ */
WARNING: multiple messages have this Message-ID (diff)
From: Eric Sandeen <sandeen@sandeen.net>
To: Takashi Sato <t-sato@yk.jp.nec.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
"viro@ZenIV.linux.org.uk" <viro@ZenIV.linux.org.uk>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
"xfs@oss.sgi.com" <xfs@oss.sgi.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"mtk.manpages@googlemail.com" <mtk.manpages@googlemail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/10] xfs: Fix error handling in write_super_lockfs/unlockfs
Date: Thu, 25 Sep 2008 16:22:17 -0500 [thread overview]
Message-ID: <48DC0109.7070608@sandeen.net> (raw)
In-Reply-To: <20080922234120.GV5811@disturbed>
Dave Chinner wrote:
> xfs_fs_log_dummy() currently is void because it had nowhere to
> return errors to. It silently throws away errors because of this.
> Hence the correct thing to do here is to fix xfs_fs_log_dummy()
> to return the errors it currently ignores. i.e. catch the errors
> from xfs_trans_reserve() and xfs_trans_commit() calls in
> xfs_fs_log_dummy().
>
> Cheers,
>
> Dave.
>
Here's that part in case it's helpful :) Feel free to roll it into
your patch.
-Eric
Make xfs_fs_log_dummy() return errors which can then be returned by
xfs_fs_lockfs(), once it is capable of doing so.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
Index: linux-2.6/fs/xfs/xfs_fsops.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.c 2008-08-04 15:30:31.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.c 2008-09-25 16:16:46.916001110 -0500
@@ -589,17 +589,19 @@ out:
return 0;
}
-void
+int
xfs_fs_log_dummy(
xfs_mount_t *mp)
{
xfs_trans_t *tp;
xfs_inode_t *ip;
+ int error = 0;
tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1);
- if (xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0)) {
+ error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0);
+ if (error) {
xfs_trans_cancel(tp, 0);
- return;
+ return error;
}
ip = mp->m_rootip;
@@ -609,9 +611,10 @@ xfs_fs_log_dummy(
xfs_trans_ihold(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
- xfs_trans_commit(tp, 0);
+ error = xfs_trans_commit(tp, 0);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
+ return error;
}
int
Index: linux-2.6/fs/xfs/xfs_fsops.h
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.h 2008-06-05 13:44:24.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.h 2008-09-25 16:16:58.303000603 -0500
@@ -25,6 +25,6 @@ extern int xfs_fs_counts(xfs_mount_t *mp
extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
xfs_fsop_resblks_t *outval);
extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
-extern void xfs_fs_log_dummy(xfs_mount_t *mp);
+extern int xfs_fs_log_dummy(xfs_mount_t *mp);
#endif /* __XFS_FSOPS_H__ */
WARNING: multiple messages have this Message-ID (diff)
From: Eric Sandeen <sandeen@sandeen.net>
To: Takashi Sato <t-sato@yk.jp.nec.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Subject: Re: [PATCH 4/10] xfs: Fix error handling in write_super_lockfs/unlockfs
Date: Thu, 25 Sep 2008 16:22:17 -0500 [thread overview]
Message-ID: <48DC0109.7070608@sandeen.net> (raw)
In-Reply-To: <20080922234120.GV5811@disturbed>
Dave Chinner wrote:
> xfs_fs_log_dummy() currently is void because it had nowhere to
> return errors to. It silently throws away errors because of this.
> Hence the correct thing to do here is to fix xfs_fs_log_dummy()
> to return the errors it currently ignores. i.e. catch the errors
> from xfs_trans_reserve() and xfs_trans_commit() calls in
> xfs_fs_log_dummy().
>
> Cheers,
>
> Dave.
>
Here's that part in case it's helpful :) Feel free to roll it into
your patch.
-Eric
Make xfs_fs_log_dummy() return errors which can then be returned by
xfs_fs_lockfs(), once it is capable of doing so.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
Index: linux-2.6/fs/xfs/xfs_fsops.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.c 2008-08-04 15:30:31.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.c 2008-09-25 16:16:46.916001110 -0500
@@ -589,17 +589,19 @@ out:
return 0;
}
-void
+int
xfs_fs_log_dummy(
xfs_mount_t *mp)
{
xfs_trans_t *tp;
xfs_inode_t *ip;
+ int error = 0;
tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1);
- if (xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0)) {
+ error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0);
+ if (error) {
xfs_trans_cancel(tp, 0);
- return;
+ return error;
}
ip = mp->m_rootip;
@@ -609,9 +611,10 @@ xfs_fs_log_dummy(
xfs_trans_ihold(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
- xfs_trans_commit(tp, 0);
+ error = xfs_trans_commit(tp, 0);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
+ return error;
}
int
Index: linux-2.6/fs/xfs/xfs_fsops.h
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_fsops.h 2008-06-05 13:44:24.000000000 -0500
+++ linux-2.6/fs/xfs/xfs_fsops.h 2008-09-25 16:16:58.303000603 -0500
@@ -25,6 +25,6 @@ extern int xfs_fs_counts(xfs_mount_t *mp
extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
xfs_fsop_resblks_t *outval);
extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
-extern void xfs_fs_log_dummy(xfs_mount_t *mp);
+extern int xfs_fs_log_dummy(xfs_mount_t *mp);
#endif /* __XFS_FSOPS_H__ */
next prev parent reply other threads:[~2008-09-25 21:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 10:56 [PATCH 4/10] xfs: Fix error handling in write_super_lockfs/unlockfs Takashi Sato
2008-09-22 10:56 ` Takashi Sato
2008-09-22 10:56 ` Takashi Sato
2008-09-22 23:41 ` Dave Chinner
2008-09-25 21:22 ` Eric Sandeen [this message]
2008-09-25 21:22 ` Eric Sandeen
2008-09-25 21:22 ` Eric Sandeen
2008-09-25 21:22 ` Eric Sandeen
-- strict thread matches above, loose matches on Subject: below --
2008-09-22 10:56 Takashi Sato
2008-09-26 8:58 Takashi Sato
2008-09-26 8:58 ` Takashi Sato
2008-09-26 8:58 ` Takashi Sato
2008-09-26 8:58 Takashi Sato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DC0109.7070608@sandeen.net \
--to=sandeen@sandeen.net \
--cc=akpm@linux-foundation.org \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=t-sato@yk.jp.nec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.