]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/ext4/namei.c
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[linux.git] / fs / ext4 / namei.c
index 1290295340758c1b47d211f853ee4b6433888658..a427d2031a8dacb1f4a0379da72c85d3bfbd746a 100644 (file)
@@ -1312,7 +1312,7 @@ void ext4_fname_setup_ci_filename(struct inode *dir, const struct qstr *iname,
 {
        int len;
 
-       if (!IS_CASEFOLDED(dir)) {
+       if (!IS_CASEFOLDED(dir) || !EXT4_SB(dir->i_sb)->s_encoding) {
                cf_name->name = NULL;
                return;
        }
@@ -2183,7 +2183,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
 
 #ifdef CONFIG_UNICODE
        if (ext4_has_strict_mode(sbi) && IS_CASEFOLDED(dir) &&
-           utf8_validate(sbi->s_encoding, &dentry->d_name))
+           sbi->s_encoding && utf8_validate(sbi->s_encoding, &dentry->d_name))
                return -EINVAL;
 #endif