diff --git a/fs/hmdfs/hmdfs_share.c b/fs/hmdfs/hmdfs_share.c index 4035ebf9ffa6e21e5984bb35b6126673dda8a461..436d3324fc19908223c8fc41a5c86b6bd74fbc49 100644 --- a/fs/hmdfs/hmdfs_share.c +++ b/fs/hmdfs/hmdfs_share.c @@ -157,13 +157,13 @@ bool in_share_dir(struct dentry *child_dentry) inline bool is_share_dir(struct inode *inode, const char *name) { - return (S_ISDIR(inode->i_mode) && - !strncmp(name, SHARE_RESERVED_DIR, strlen(SHARE_RESERVED_DIR))); + return (S_ISDIR(inode->i_mode) && + !strncmp(name, SHARE_RESERVED_DIR, sizeof(SHARE_RESERVED_DIR))); } int get_path_from_share_table(struct hmdfs_sb_info *sbi, - struct dentry *cur_dentry, - struct path *src_path) + struct dentry *cur_dentry, + struct path *src_path) { struct hmdfs_share_item *item; const char *path_name; diff --git a/fs/hmdfs/inode_root.c b/fs/hmdfs/inode_root.c index 91ca37bb6b7c3872533fd2d42230459359b2c13a..d1d996eef369cb04c78e1a57d44cc1a5aac461e9 100644 --- a/fs/hmdfs/inode_root.c +++ b/fs/hmdfs/inode_root.c @@ -143,7 +143,7 @@ struct dentry *hmdfs_device_lookup(struct inode *parent_inode, trace_hmdfs_device_lookup(parent_inode, child_dentry, flags); if (!strncmp(d_name, DEVICE_VIEW_LOCAL, - sizeof(DEVICE_VIEW_LOCAL) - 1)) { + sizeof(DEVICE_VIEW_LOCAL))) { err = init_hmdfs_dentry_info(sbi, child_dentry, HMDFS_LAYER_SECOND_LOCAL); if (err) { @@ -170,7 +170,7 @@ struct dentry *hmdfs_device_lookup(struct inode *parent_inode, goto out; } } else if (!strncmp(d_name, DEVICE_VIEW_CLOUD, - sizeof(DEVICE_VIEW_CLOUD) - 1)) { + sizeof(DEVICE_VIEW_CLOUD))) { err = init_hmdfs_dentry_info(sbi, child_dentry, HMDFS_LAYER_SECOND_CLOUD); if (err) {