summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4_write.c2
-rw-r--r--fs/fat/fat_write.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index f22af45d1b9..ea4c5d4157c 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -473,7 +473,7 @@ static int ext4fs_delete_file(int inodeno)
* special case for symlinks whose target are small enough that
*it fits in struct ext2_inode.b.symlink: no block had been allocated
*/
- if ((le16_to_cpu(inode.mode) & S_IFLNK) &&
+ if (S_ISLNK(le16_to_cpu(inode.mode)) &&
le32_to_cpu(inode.size) <= sizeof(inode.b.symlink)) {
no_blocks = 0;
}
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 00541ebc3a4..413fc432ebe 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -141,6 +141,8 @@ static int set_name(fat_itr *itr, const char *filename, char *shortname)
if (!strcmp(buf, filename)) {
ret = 1;
goto out;
+ } else if (!strcasecmp(buf, filename)) {
+ goto out_ret;
}
/* Construct an indexed short name */
@@ -177,12 +179,13 @@ static int set_name(fat_itr *itr, const char *filename, char *shortname)
if (find_directory_entry(itr, buf))
continue;
- debug("chosen short name: %s\n", buf);
- /* Each long name directory entry takes 13 characters. */
- ret = (strlen(filename) + 25) / 13;
- goto out;
+ goto out_ret;
}
return -EIO;
+out_ret:
+ debug("chosen short name: %s\n", buf);
+ /* Each long name directory entry takes 13 characters. */
+ ret = (strlen(filename) + 25) / 13;
out:
memcpy(shortname, &dirent, SHORT_NAME_SIZE);
return ret;