public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix xfs kernel so  2GiB logs work
@ 2008-04-23 23:35 Michael Nishimoto
  2008-04-24  0:45 ` David Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Nishimoto @ 2008-04-23 23:35 UTC (permalink / raw)
  To: XFS Mailing List

I hope that I've got everything now.

Ensure that 2 GiB xfs logs work properly.

We found this while experimenting with 2GiB xfs logs.
The previous code never assumed that xfs logs would
ever get so large.

Signed-off-by: Michael Nishimoto <miken@agami.com>
===========================================================
--- xfs_log.2.c 2008-04-01 11:55:45.000000000 -0700
+++ xfs_log.3.c 2008-04-01 11:56:53.000000000 -0700
@@ -230,20 +230,24 @@
  static void
  xlog_grant_add_space_write(struct log *log, int bytes)
  {
-       log->l_grant_write_bytes += bytes;
-       if (log->l_grant_write_bytes > log->l_logsize) {
-               log->l_grant_write_bytes -= log->l_logsize;
-               log->l_grant_write_cycle++;
+       int tmp = log->l_logsize - log->l_grant_write_bytes;
+       if (tmp > bytes)
+               log->l_grant_write_bytes += bytes;
+       else {
+               log->l_grant_write_cycle++;
+               log->l_grant_write_bytes = bytes - tmp;
         }
  }

  static void
  xlog_grant_add_space_reserve(struct log *log, int bytes)
  {
-       log->l_grant_reserve_bytes += bytes;
-       if (log->l_grant_reserve_bytes > log->l_logsize) {
-               log->l_grant_reserve_bytes -= log->l_logsize;
-               log->l_grant_reserve_cycle++;
+       int tmp = log->l_logsize - log->l_grant_reserve_bytes;
+       if (tmp > bytes)
+               log->l_grant_reserve_bytes += bytes;
+       else {
+               log->l_grant_reserve_cycle++;
+               log->l_grant_reserve_bytes = bytes - tmp;
         }
  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix xfs kernel so  2GiB logs work
  2008-04-23 23:35 [PATCH] fix xfs kernel so 2GiB logs work Michael Nishimoto
@ 2008-04-24  0:45 ` David Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: David Chinner @ 2008-04-24  0:45 UTC (permalink / raw)
  To: Michael Nishimoto; +Cc: XFS Mailing List

On Wed, Apr 23, 2008 at 04:35:06PM -0700, Michael Nishimoto wrote:
> I hope that I've got everything now.

Almost ;)

> Ensure that 2 GiB xfs logs work properly.
> 
> We found this while experimenting with 2GiB xfs logs.
> The previous code never assumed that xfs logs would
> ever get so large.
> 
> Signed-off-by: Michael Nishimoto <miken@agami.com>
> ===========================================================
> --- xfs_log.2.c 2008-04-01 11:55:45.000000000 -0700
> +++ xfs_log.3.c 2008-04-01 11:56:53.000000000 -0700

We normally diff from the root of the kernel tree between a
pristine tree and a modified tree such that:

--- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-04-23 09:31:29.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_log.c      2008-04-24 10:39:15.696830268 +1000
@@ -226,20 +226,24 @@ xlog_grant_sub_space(struct log *log, in
 static void
 xlog_grant_add_space_write(struct log *log, int bytes)
....

is the path in the patch and you apply it via 'patch -p1 < file'
in the root of the kernel tree.

> @@ -230,20 +230,24 @@
>  static void
>  xlog_grant_add_space_write(struct log *log, int bytes)
>  {
> -       log->l_grant_write_bytes += bytes;
> -       if (log->l_grant_write_bytes > log->l_logsize) {
   ^^^^^^^

And it looks like your mailer has converted tabs to spaces.

Don't worry about either of those things for this patch, I've
fixed them up when applying them to my test tree.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-24  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 23:35 [PATCH] fix xfs kernel so 2GiB logs work Michael Nishimoto
2008-04-24  0:45 ` David Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox