Skip to content

Commit

Permalink
ocfs2: use actual name length when find entry in ocfs2_orphan_del()
Browse files Browse the repository at this point in the history
If the namelen is 20 and name only has actual length 16, it will fail in
ocfs2_find_entry because of mismatch.  So use actual name length when find
entry.

Signed-off-by: Joseph Qi <[email protected]>
Signed-off-by: Yiwen Jiang <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
josephhz authored and torvalds committed Apr 14, 2015
1 parent e073fc5 commit e38a573
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,10 +2322,10 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,

trace_ocfs2_orphan_del(
(unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno,
name, namelen);
name, strlen(name));

/* find it's spot in the orphan directory */
status = ocfs2_find_entry(name, namelen, orphan_dir_inode,
status = ocfs2_find_entry(name, strlen(name), orphan_dir_inode,
&lookup);
if (status) {
mlog_errno(status);
Expand Down

0 comments on commit e38a573

Please sign in to comment.