diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index d2fca802f809972a9b9b05171e02fa78fa054de7..ee1ec2c7723c9505c47547b8559dbbf059bc011d 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -22,7 +22,7 @@
 
 static inline void mapping_set_error(struct address_space *mapping, int error)
 {
-	if (error) {
+	if (unlikely(error)) {
 		if (error == -ENOSPC)
 			set_bit(AS_ENOSPC, &mapping->flags);
 		else