Skip to contentSkip to conversation

coredump: fix dump_align() helper

PATCH New Alexander Shishkin 1 participant 1 message Dec 11, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coredump: fix dump_align() helper

The recent rework that introduced dump_emit() and dump_align() breaks existing core dump logic, which relies on these functions returning non zero when everything is fine, but right now dump_align() returns 0 if the current offset is already aligned on a given boundary.

---
 fs/coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/coredump.c +1 -1
index 62406b6..0be8c01 100644
@@ -734,6 +734,6 @@ int dump_align(struct coredump_params *cprm, int align)
 	unsigned mod = cprm->written & (align - 1);
 	if (align & (align - 1))
 		return -EINVAL;
-	return mod ? dump_skip(cprm, align - mod) : 0;
+	return mod ? dump_skip(cprm, align - mod) : 1;
 }
 EXPORT_SYMBOL(dump_align);
Signature · 1 line
1.8.5.1