Skip to contentSkip to conversation

pstore-ram: remove superfluous memory size check

RFC In review Kiran Raparthy 3 participants 4 messages Feb 10, 2015 – Feb 12, 2015 Pstore filesystem

lore
Share & tools
lore
#0 lore raw

RFC 1/1 pstore-ram: remove superfluous memory size check

From: Mark Salyzyn <[email protected]>

pstore-ram: remove superfluous memory size check

All previous checks will fail with error if memory size is not sufficient to register a zone, so this legacy check has become redundant.

Cc Anton Vorontsov <[email protected]>
Cc Colin Cross <[email protected]>
Cc Kees Cook <[email protected]>
Cc Tony Luck <[email protected]>
[Kiran: Added Context]

---
This is one of the number of patches from the Android AOSP common.git tree, which is used on Android devices. I wanted to submit it for review to see if it should go upstream.

 fs/pstore/ram.c | 9 ---------
 1 file changed, 9 deletions(-)
fs/pstore/ram.c +0 -9
index 8613e5b..34ed8f8 100644
@@ -474,14 +474,6 @@ static int ramoops_probe(struct platform_device *pdev)
 	if (err)
 		goto fail_init_fprz;
 
-	if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
-		pr_err("memory size too small, minimum is %zu\n",
-			cxt->console_size + cxt->record_size +
-			cxt->ftrace_size);
-		err = -EINVAL;
-		goto fail_cnt;
-	}
-
 	cxt->pstore.data = cxt;
 	/*
 	 * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
@@ -525,7 +517,6 @@ fail_buf:
 	kfree(cxt->pstore.buf);
 fail_clear:
 	cxt->pstore.bufsize = 0;
-fail_cnt:
 	kfree(cxt->fprz);
 fail_init_fprz:
 	kfree(cxt->cprz);
Signature · 1 line
1.8.2.1
#1 lore raw

Please refer to '[PATCH v2 2/5] pstore: remove superfluous memory size check'

Sincerely -- Mark Salyzyn

Quoted 52 lines · Kiran Raparthy

From: Mark Salyzyn <[email protected]>

pstore-ram: remove superfluous memory size check

All previous checks will fail with error if memory size is not sufficient to register a zone, so this legacy check has become redundant.

Cc Anton Vorontsov <[email protected]>
Cc Colin Cross <[email protected]>
Cc Kees Cook <[email protected]>
Cc Tony Luck <[email protected]>
[Kiran: Added Context]

---
This is one of the number of patches from the Android AOSP common.git tree, which is used on Android devices. I wanted to submit it for review to see if it should go upstream.
[PATCH v2 2/5] pstore: remove superfluous memory size check

  fs/pstore/ram.c | 9 ---------
  1 file changed, 9 deletions(-)
fs/pstore/ram.c +0 -9
index 8613e5b..34ed8f8 100644
@@ -474,14 +474,6 @@ static int ramoops_probe(struct platform_device *pdev)
  	if (err)
  		goto fail_init_fprz;
 
-	if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
-		pr_err("memory size too small, minimum is %zu\n",
-			cxt->console_size + cxt->record_size +
-			cxt->ftrace_size);
-		err = -EINVAL;
-		goto fail_cnt;
-	}
-
  	cxt->pstore.data = cxt;
  	/*
  	 * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
@@ -525,7 +517,6 @@ fail_buf:
  	kfree(cxt->pstore.buf);
  fail_clear:
  	cxt->pstore.bufsize = 0;
-fail_cnt:
  	kfree(cxt->fprz);
  fail_init_fprz:
  	kfree(cxt->cprz);
#2 lore raw
Quoted 2 lines · Mark Salyzyn

Please refer to '[PATCH v2 2/5] pstore: remove superfluous memory size check'

Cool,thanks for pointing.
Regards,
Kiran

Quoted 59 lines

Sincerely -- Mark Salyzyn

Quoted 53 lines · Kiran Raparthy

From: Mark Salyzyn <[email protected]>

pstore-ram: remove superfluous memory size check

All previous checks will fail with error if memory size is not sufficient to register a zone, so this legacy check has become redundant.

Cc Anton Vorontsov <[email protected]>
Cc Colin Cross <[email protected]>
Cc Kees Cook <[email protected]>
Cc Tony Luck <[email protected]>
[Kiran: Added Context]

---
This is one of the number of patches from the Android AOSP common.git tree, which is used on Android devices. I wanted to submit it for review to see if it should go upstream.
[PATCH v2 2/5] pstore: remove superfluous memory size check

  fs/pstore/ram.c | 9 ---------
  1 file changed, 9 deletions(-)
fs/pstore/ram.c +0 -8
index 8613e5b..34ed8f8 100644
@@ -474,14 +474,6 @@ static int ramoops_probe(struct platform_device *pdev)
        if (err)
                goto fail_init_fprz;
  -     if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
-               pr_err("memory size too small, minimum is %zu\n",
-                       cxt->console_size + cxt->record_size +
-                       cxt->ftrace_size);
-               err = -EINVAL;
-               goto fail_cnt;
-       }
-
        cxt->pstore.data = cxt;
        /*
         * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
@@ -525,7 +517,6 @@ fail_buf:
        kfree(cxt->pstore.buf);
  fail_clear:
        cxt->pstore.bufsize = 0;
-fail_cnt:
        kfree(cxt->fprz);
  fail_init_fprz:
        kfree(cxt->cprz);
#3 lore raw
Quoted 3 lines · Kiran Kumar
Quoted 2 lines · Mark Salyzyn

Please refer to '[PATCH v2 2/5] pstore: remove superfluous memory size check'

FYI: Linus pulled the pstore branch - so this patch is now upstream.

-Tony