| .. | .. |
|---|
| 12 | 12 | #include <linux/types.h> |
|---|
| 13 | 13 | #include <linux/fs.h> |
|---|
| 14 | 14 | #include <linux/f2fs_fs.h> |
|---|
| 15 | | -#include <linux/cryptohash.h> |
|---|
| 16 | 15 | #include <linux/pagemap.h> |
|---|
| 17 | 16 | #include <linux/unicode.h> |
|---|
| 18 | 17 | |
|---|
| .. | .. |
|---|
| 92 | 91 | /* |
|---|
| 93 | 92 | * Compute @fname->hash. For all directories, @fname->disk_name must be set. |
|---|
| 94 | 93 | * For casefolded directories, @fname->usr_fname must be set, and also |
|---|
| 95 | | - * @fname->cf_name if the filename is valid Unicode. |
|---|
| 94 | + * @fname->cf_name if the filename is valid Unicode and is not "." or "..". |
|---|
| 96 | 95 | */ |
|---|
| 97 | 96 | void f2fs_hash_filename(const struct inode *dir, struct f2fs_filename *fname) |
|---|
| 98 | 97 | { |
|---|
| .. | .. |
|---|
| 111 | 110 | /* |
|---|
| 112 | 111 | * If the casefolded name is provided, hash it instead of the |
|---|
| 113 | 112 | * on-disk name. If the casefolded name is *not* provided, that |
|---|
| 114 | | - * should only be because the name wasn't valid Unicode, so fall |
|---|
| 115 | | - * back to treating the name as an opaque byte sequence. Note |
|---|
| 116 | | - * that to handle encrypted directories, the fallback must use |
|---|
| 117 | | - * usr_fname (plaintext) rather than disk_name (ciphertext). |
|---|
| 113 | + * should only be because the name wasn't valid Unicode or was |
|---|
| 114 | + * "." or "..", so fall back to treating the name as an opaque |
|---|
| 115 | + * byte sequence. Note that to handle encrypted directories, |
|---|
| 116 | + * the fallback must use usr_fname (plaintext) rather than |
|---|
| 117 | + * disk_name (ciphertext). |
|---|
| 118 | 118 | */ |
|---|
| 119 | 119 | WARN_ON_ONCE(!fname->usr_fname->name); |
|---|
| 120 | 120 | if (fname->cf_name.name) { |
|---|