From: Eric Sandeen <esandeen@redhat.com>
To: Eryu Guan <eguan@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_quota: avoid segfault when report -h on non-existent path
Date: Tue, 18 Mar 2014 12:06:38 -0500 [thread overview]
Message-ID: <53287D1E.2010409@redhat.com> (raw)
In-Reply-To: <1395160746-26654-1-git-send-email-eguan@redhat.com>
On 3/18/14, 11:39 AM, Eryu Guan wrote:
> Command xfs_quota -xc "report -h" /nosuchdir would get segfault, fix
> that by checking fs_path first before dereferencing it.
>
> Cc: Eric Sandeen <esandeen@redhat.com>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
> quota/report.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/quota/report.c b/quota/report.c
> index 70894a2..d486524 100644
> --- a/quota/report.c
> +++ b/quota/report.c
> @@ -624,7 +624,7 @@ report_f(
> if (flags & ALL_MOUNTS_FLAG)
> report_any_type(fp, form, type, NULL,
> lower, upper, flags);
> - else if (fs_path->fs_flags & FS_MOUNT_POINT)
> + else if (fs_path && fs_path->fs_flags & FS_MOUNT_POINT)
> report_any_type(fp, form, type, fs_path->fs_dir,
> lower, upper, flags);
> } else while (argc > optind) {
>
I think this is ok; state_f does the same thing.
but others don't; enable_f, disable_f, off_f etc.
Also this seems to be a slight regression since v3.1.8 or so, let me double
check that and see if we need to fix something more general.
Thanks!
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-03-18 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 16:39 [PATCH] xfs_quota: avoid segfault when report -h on non-existent path Eryu Guan
2014-03-18 17:06 ` Eric Sandeen [this message]
2014-03-19 1:47 ` Jeff Liu
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=53287D1E.2010409@redhat.com \
--to=esandeen@redhat.com \
--cc=eguan@redhat.com \
--cc=sandeen@redhat.com \
--cc=xfs@oss.sgi.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 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).