Skip to contentSkip to conversation

staging/lustre: Fix max_dirty_mb output in sysfs

PATCH New Oleg Drokin 1 participant 1 message Aug 25, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/lustre: Fix max_dirty_mb output in sysfs

%ul definitely was supposed to be %lu in the format string, so we print long unsigned int value, not just unsigned int with a letter l added at the end.

---
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +3 -2
index 8f70dd2..bcf005d 100644
@@ -95,8 +95,9 @@ LUSTRE_STATIC_UINT_ATTR(timeout, &obd_timeout);
 static ssize_t max_dirty_mb_show(struct kobject *kobj, struct attribute *attr,
 				 char *buf)
 {
-	return sprintf(buf, "%ul\n",
-			obd_max_dirty_pages / (1 << (20 - PAGE_SHIFT)));
+	return sprintf(buf, "%lu\n",
+		       (unsigned long)obd_max_dirty_pages /
+		       (1 << (20 - PAGE_SHIFT)));
 }
 
 static ssize_t max_dirty_mb_store(struct kobject *kobj, struct attribute *attr,
Signature · 1 line
2.7.4