Skip to contentSkip to conversation

smb/server: fix unbuffered file position alignment check

PATCH Applied ChenXiaoSong 2 participants 2 messages Jul 26 – Jul 27

Subsystems (2)
lore
Share & tools
lore

ChenXiaoSong

author reviewer
#0 lore raw

PATCH 1/1 smb/server: fix unbuffered file position alignment check

From: ChenXiaoSong <[email protected]>

FILE_NO_INTERMEDIATE_BUFFERING is a CreateOptions flag and can be combined with other flags, such as FILE_NON_DIRECTORY_FILE.

---
 fs/smb/server/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/server/smb2pdu.c +1 -1
index 8e5dfb079f5b..7e0be7602625 100644
@@ -7915,7 +7915,7 @@ static int set_file_position_info(struct ksmbd_file *fp,
 	sector_size = inode->i_sb->s_blocksize;
 
 	if (current_byte_offset < 0 ||
-	    (fp->coption == FILE_NO_INTERMEDIATE_BUFFERING_LE &&
+	    (fp->coption & FILE_NO_INTERMEDIATE_BUFFERING_LE &&
 	     current_byte_offset & (sector_size - 1))) {
 		pr_err("CurrentByteOffset is not valid : %llu\n",
 		       current_byte_offset);
Signature · 1 line
2.54.0