[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210519004901.3829541-13-viro@zeniv.linux.org.uk>
Date: Wed, 19 May 2021 00:49:00 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Jia He <justin.he@....com>, Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Jonathan Corbet <corbet@....net>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ira Weiny <ira.weiny@...el.com>,
Eric Biggers <ebiggers@...gle.com>,
"Ahmed S. Darwish" <a.darwish@...utronix.de>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-s390 <linux-s390@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: [PATCH 13/14] d_path: prepend_path() is unlikely to return non-zero
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
fs/d_path.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/d_path.c b/fs/d_path.c
index ba629879a4bf..8a9cd44f6689 100644
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -187,7 +187,7 @@ char *__d_path(const struct path *path,
DECLARE_BUFFER(b, buf, buflen);
prepend(&b, "", 1);
- if (prepend_path(path, root, &b) > 0)
+ if (unlikely(prepend_path(path, root, &b) > 0))
return NULL;
return extract_string(&b);
}
@@ -199,7 +199,7 @@ char *d_absolute_path(const struct path *path,
DECLARE_BUFFER(b, buf, buflen);
prepend(&b, "", 1);
- if (prepend_path(path, &root, &b) > 1)
+ if (unlikely(prepend_path(path, &root, &b) > 1))
return ERR_PTR(-EINVAL);
return extract_string(&b);
}
@@ -396,7 +396,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
DECLARE_BUFFER(b, page, PATH_MAX);
prepend(&b, "", 1);
- if (prepend_path(&pwd, &root, &b) > 0)
+ if (unlikely(prepend_path(&pwd, &root, &b) > 0))
prepend(&b, "(unreachable)", 13);
rcu_read_unlock();
--
2.11.0
Powered by blists - more mailing lists