diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index eb19308a64e2..9b4f51754f2b 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -1153,7 +1153,7 @@ static ssize_t cifs_zfsacl_flags_proc_write(struct file *file, idmap_flags = flags & MODFLAG_ALL_IDMAP; - if ((flags & MODFLAG_ALL_IDMAP) == 0) { + if (idmap_flags == 0) { cifs_dbg(VFS, "At least one idmap-related flag must be set"); return -EINVAL; } diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c index 625ee093cbd7..e83c7e96efdc 100644 --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -2136,7 +2136,7 @@ convert_smb_sid_to_nfs_who(struct cifs_sid *psid, u32 *iflag, u32 *who_id, u32 * cifs_dbg(FYI, "%s: subauthority count [%u] exceeds " "maxiumum possible value.\n", __func__, psid->num_subauth); - return -EIO; + return -EINVAL; } rc = convert_smb_sid_to_nfs_who_special(psid, iflag, who_id, flags); @@ -2503,6 +2503,10 @@ int ntsd_to_zfsacl_xattr(struct cifs_ntsd *pntsd, return -EIO; dacloffset = le32_to_cpu(pntsd->dacloffset); + if (!dacloffset) { + return generate_null_zfsacl(buf_out); + } + dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset); if (dacl_ptr == NULL) { return generate_null_zfsacl(buf_out); @@ -2797,7 +2801,7 @@ force_smb3_dacl_info(struct smb3_sd *sd, u32 acl_flag) } /* - * This is special handling for either NULL or emtpy ACLs. + * This is special handling for either NULL or empty ACLs. * Returns 0 if ACL is generated, -EAGAIN if regular parsing * required, and otherwise -errno. */