linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH v3 08/15] e2fsck: add fast commit setup code
Date: Thu, 21 Jan 2021 11:54:06 -0500	[thread overview]
Message-ID: <YAmxrkT81IdsSXe4@mit.edu> (raw)
In-Reply-To: <20210120212641.526556-9-user@harshads-520.kir.corp.google.com>

On Wed, Jan 20, 2021 at 01:26:34PM -0800, Harshad Shirwadkar wrote:
> diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
> index fdcb28f6..eb2e6549 100644
> --- a/lib/ext2fs/ext2fs.h
> +++ b/lib/ext2fs/ext2fs.h
> @@ -2148,4 +2148,7 @@ static inline unsigned int ext2_dir_htree_level(ext2_filsys fs)
>  }
>  #endif
>  
> +/* Commonly used helpers */
> +#define max(a, b) ((a) > (b) ? (a) : (b))
> +
>  #endif /* _EXT2FS_EXT2FS_H */

It's better not to add this to a publically exported file, such as
lib/ext2fs/ext2fs.h, since it may conflict with other userspace
application which may define their own max file.

Something which we might want to do is to add something like
linux/minmax.h from the kernel sources to libsupport.  This defines a
max() macro which does paranoid typechecking to make sure we don't
accidentally compare an unsigned int to an signed int, which can
potential security problems with maliciously fuzzed file system
images.  :-)

						- Ted

  reply	other threads:[~2021-01-21 16:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 21:26 [PATCH v3 00/15] Fast commit changes for e2fsprogs Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 01/15] ext2fs: move calculate_summary_stats to ext2fs lib Harshad Shirwadkar
2021-01-21 15:54   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 02/15] e2fsck: add kernel endian-ness conversion macros Harshad Shirwadkar
2021-01-21 15:54   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 03/15] e2fsck: port fc changes from kernel's recovery.c to e2fsck Harshad Shirwadkar
2021-01-21 15:54   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 04/15] libext2fs: provide APIs to configure fast commit blocks Harshad Shirwadkar
2021-01-21 15:56   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 05/15] e2fsprogs: make userspace tools number of fast commits blocks aware Harshad Shirwadkar
2021-01-21 15:58   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 06/15] ext2fs: add new APIs needed for fast commits Harshad Shirwadkar
2021-01-21  5:58   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 07/15] e2fsck: add function to rewrite extent tree Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 08/15] e2fsck: add fast commit setup code Harshad Shirwadkar
2021-01-21 16:54   ` Theodore Ts'o [this message]
2021-01-20 21:26 ` [PATCH v3 09/15] e2fsck: add fast commit scan pass Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 10/15] e2fsck: add fast commit replay skeleton Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 11/15] e2fsck: add fc replay for link, unlink, creat tags Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 12/15] e2fsck: add replay for add_range, del_range, and inode tags Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 13/15] debugfs: add fast commit support to logdump Harshad Shirwadkar
2021-01-21 16:49   ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 14/15] tests: add fast commit recovery tests Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 15/15] ext4: fix tests to account for new dumpe2fs output Harshad Shirwadkar
2021-01-21 16:01   ` Theodore Ts'o
2021-01-21  5:22 ` [PATCH v3 00/15] Fast commit changes for e2fsprogs Theodore Ts'o

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=YAmxrkT81IdsSXe4@mit.edu \
    --to=tytso@mit.edu \
    --cc=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).