Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] xfs: log proper length of superblock
@ 2019-09-23 21:18 Eric Sandeen
  2019-09-23 21:44 ` Eric Sandeen
  2019-09-23 23:48 ` Darrick J. Wong
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sandeen @ 2019-09-23 21:18 UTC (permalink / raw)
  To: linux-xfs

xfs_trans_log_buf takes first byte, last byte as args.  In this
case, it should be from 0 to sizeof() - 1.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

I should have audited everything when I sent the last patch for
this type of error.  hch suggested changing the interface but it's
all pretty grotty and I'm hesitant for now.

I think maybe a new/separate function to take start, len might
make sense so that not every caller needs to be munged into a new
format, because some of the existing callers would then become more
complex...

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index a08dd8f40346..ac6cdca63e15 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -928,7 +928,7 @@ xfs_log_sb(
 
 	xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb);
 	xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF);
-	xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb));
+	xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb) - 1);
 }
 
 /*


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

end of thread, other threads:[~2019-09-23 23:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-23 21:18 [PATCH] xfs: log proper length of superblock Eric Sandeen
2019-09-23 21:44 ` Eric Sandeen
2019-09-23 22:34   ` Dave Chinner
2019-09-23 23:48 ` Darrick J. Wong

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