Re: [PATCH v2 2/2] btrfs: verify max_inline mount parameter

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

 





On 02/14/2018 12:28 AM, David Sterba wrote:
On Tue, Feb 13, 2018 at 05:49:50PM +0800, Anand Jain wrote:
We aren't verifying the parameter passed to the max_inline mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o max_inline=abc.
This patch converts the max_inline option to %d and checks if it's a
number >= 0.

As the max_inline is a size, the suffixes are allowed here and this is
documented in the btrfs(5) page. I've checked all current options and
max_inline should be the only one where we want the suffixes.

 Oh. I ran out of ideas how to fix this.
 One idea is ... step1: memparse() 4K (for example) so we would get
 4096, step2: convert obtained 4096 back to 4K and step3: do string cmp
 of step1 and step2. This way we eliminate other junk chars passed.
 But looks like there isn't any tool to do the step2.

Thanks, Anand

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux