erofs-utils: lib: fix packed xattr prefix seek
PATCH 1/1 erofs-utils: lib: fix packed xattr prefix seek
erofs_xattr_flush_name_prefixes() records the current packed file offset, writes xattr prefixes with erofs_io_pwrite(), and then seeks back to the new absolute end position.
Use SEEK_SET for that final lseek(). SEEK_CUR adds the tracked offset to the unchanged file position and can leave the packed file offset too far forward.
Signed-off-by Vansh Choudhary <[email protected]>
--- lib/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/xattr.c +1 -1
@@ -946,7 +946,7 @@ int erofs_xattr_flush_name_prefixes(struct erofs_importer *im, bool plain)erofs_bdrop (bh, false); }else {DBG_BUGON (bmgr); -if (lseek (vf->fd, offset,SEEK_CUR ) <0 ) +if (lseek (vf->fd, offset,SEEK_SET ) <0 )return -errno; }erofs_sb_set_xattr_prefixes (sbi);
Signature · 1 line
2.43.0