archive mirror
 help / color / mirror / Atom feed
* [bug report] cifsd: add file operations
@ 2021-07-07 10:11 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-07-07 10:11 UTC (permalink / raw)
  To: namjae.jeon; +Cc: linux-cifs

Hello Namjae Jeon,

The patch f44158485826: "cifsd: add file operations" from Mar 16,
2021, leads to the following static checker warning:

	fs/ksmbd/vfs_cache.c:661 ksmbd_file_table_flush()
	warn: was expecting a 64 bit value instead of '0'

   653  int ksmbd_file_table_flush(struct ksmbd_work *work)
   654  {
   655          struct ksmbd_file       *fp = NULL;
   656          unsigned int            id;
   657          int                     ret;
   659          read_lock(&work->sess->file_table.lock);
   660          idr_for_each_entry(work->sess->file_table.idr, fp, id) {
   661                  ret = ksmbd_vfs_fsync(work, fp->volatile_id, KSMBD_NO_FID);

TBH, I'm not sure what's triggering this warning, but ksmbd_vfs_fsync()
takes a u64 and fp->volatile_id is a u32.  The ksmbd_lookup_fd_slow()
function takes a u32 so passing a u64 value seems like it would lead to
a bug.  And smb2_flush() passes a u64 so this seems buggy.

   662                  if (ret)
   663                          break;
   664          }
   665          read_unlock(&work->sess->file_table.lock);
   666          return ret;
   667  }

dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-07 10:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 10:11 [bug report] cifsd: add file operations Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).