Skip to contentSkip to conversation

gfs2: Fix the return value in gfs2_get_link() kernel-doc

PATCH In review Karl Mehltretter 2 participants 2 messages Sep 12 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: Fix the return value in gfs2_get_link() kernel-doc

gfs2_get_link() returns the link target or an error pointer, but its kernel-doc still describes an integer status. The mismatch dates back to the change in its predecessor's follow_link calling convention.

Describe the returned pointer and error value.

Fixes 680baacbca69 ("new ->follow_link() and ->put_link() calling conventions")
Assisted-by LLM
---
 fs/gfs2/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/inode.c +1 -1
index f361876c5583353a1196ed35be1c95af33a90c02..d5e03ec89127254654dceaff56322ed617a3400a 100644
@@ -1900,7 +1900,7 @@ static int gfs2_rename2(struct mnt_idmap *idmap, struct inode *odir,
  *
  * This can handle symlinks of any size.
  *
- * Returns: 0 on success or error code
+ * Returns: the link target on success, an ERR_PTR() on failure
  */
 
 static const char *gfs2_get_link(struct dentry *dentry,
Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw
Quoted 7 lines · Karl Mehltretter

gfs2_get_link() returns the link target or an error pointer, but its kernel-doc still describes an integer status. The mismatch dates back to the change in its predecessor's follow_link calling convention.

Describe the returned pointer and error value.

Fixes 680baacbca69 ("new ->follow_link() and ->put_link() calling conventions")

Actually, the problem was introduced in commit c177c2ac8c5a ("Switch gfs2 to nd_set_link()"). I've updated the description and applied the patch to for-next.

Thanks,
Andreas

Quoted 22 lines
Assisted-by LLM
---
 fs/gfs2/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/inode.c +1 -2
index f361876c5583353a1196ed35be1c95af33a90c02..d5e03ec89127254654dceaff56322ed617a3400a 100644
@@ -1900,7 +1900,7 @@ static int gfs2_rename2(struct mnt_idmap *idmap, struct inode *odir,
  *
  * This can handle symlinks of any size.
  *
- * Returns: 0 on success or error code
+ * Returns: the link target on success, an ERR_PTR() on failure
  */
 
 static const char *gfs2_get_link(struct dentry *dentry,
--

2.39.5 (Apple Git-154)