Re: [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Tue, Jan 22, 2019 at 08:38:17PM -0500, Jeff Mahoney wrote:
> On 1/21/19 5:51 PM, Dave Chinner wrote:
> > On Mon, Jan 21, 2019 at 11:33:11AM -0500, jeffm@xxxxxxxx wrote:
> >> From: Jeff Mahoney <jeffm@xxxxxxxx>
> >>
> >> The regex assumes there will be whitespace after the .. in the ranges
> >> and, with larger offsets, there may not be any.
> > 
> > Does more than this, right?
> 
> I suppose.  It converts the interpreted .. into a literal .., which I
> believe was the original intent.
> 
> >> Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
> >> ---
> >>  common/filter | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/common/filter b/common/filter
> >> index ed082d24..b4443a34 100644
> >> --- a/common/filter
> >> +++ b/common/filter
> >> @@ -532,7 +532,7 @@ _filter_filefrag()
> >>  		next
> >>  	}
> >>  	($ext, $logical, $physical, $length) =
> >> -		(/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
> >> +		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)
> > 
> > This is escaping "..", too, isn't it? 
> 
> Yes, but what else could the .. in the original regex have been
> referring to?  I don't recall seeing any other filefrag format that
> would match otherwise.

Neither do I. My point was it was a change that was not documented
in the commit message and so there might be something I was missing.

> I don't have a problem documenting it further, though.

That'd be great, thanks!

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux