mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] fs: return error pointers from ->get_link() on failure
@ 2026-11-02  9:08 Sascha Hauer
  2026-11-02  9:08 ` [PATCH 1/3] fs: cramfs: return an error pointer from cramfs_get_link() Sascha Hauer
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-11-02  9:08 UTC (permalink / raw)
  To: BAREBOX

Like in Linux, the callers of ->get_link() expect an error pointer when
the link can't be read: readlinkat() checks the result only with
IS_ERR() before copying from it, and path lookup takes NULL to mean that
the link has already been followed and continues from the directory
containing the link. barebox has no nd_jump_link(), so a NULL from
->get_link() is never legitimate there.

9p and nfs already return error pointers, and the squashfs series posted
separately converts squashfs_get_link(). This series converts the
remaining file systems:

- legacy returned NULL when the driver's readlink failed.
- cramfs and ext4 checked their read helpers for return values these
  never produce, so a link that couldn't be read was returned as a valid,
  partly zeroed link and stayed cached in inode->i_link.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (3):
      fs: cramfs: return an error pointer from cramfs_get_link()
      fs: ext4: return an error pointer from ext_get_link()
      fs: legacy: return an error pointer from legacy_get_link()

 fs/cramfs/cramfs.c    | 7 +++++--
 fs/ext4/ext_barebox.c | 3 ++-
 fs/legacy.c           | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)
---
base-commit: f2e574b9c63c6da07a06179a868cae8a471ec176
change-id: 20261102-fs-getlink-fixes-d634fd50d1f9

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-02 14:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02  9:08 [PATCH 0/3] fs: return error pointers from ->get_link() on failure Sascha Hauer
2026-11-02  9:08 ` [PATCH 1/3] fs: cramfs: return an error pointer from cramfs_get_link() Sascha Hauer
2026-11-02  9:08 ` [PATCH 2/3] fs: ext4: return an error pointer from ext_get_link() Sascha Hauer
2026-11-02  9:08 ` [PATCH 3/3] fs: legacy: return an error pointer from legacy_get_link() Sascha Hauer
2026-11-02 10:21 ` [PATCH 0/3] fs: return error pointers from ->get_link() on failure Ahmad Fatoum
2026-11-02 14:29   ` Sascha Hauer
2026-11-02 13:25 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox