linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 11/11] btrfs: The file argument for fsync() is never null
@ 2010-05-29  9:49 Dan Carpenter
  2010-06-14 20:07 ` Johannes Hirte
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2010-05-29  9:49 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Yan Zheng, Josef Bacik, Christoph Hellwig, Chris Mason, kernel-janitors

The "file" argument for fsync is never null so we can remove this check.

What drew my attention here is that 7ea8085910e: "drop unused dentry 
argument to ->fsync" introduced an unconditional dereference at the
start of the function and that generated a smatch warning.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 787b50a..e252d23 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1140,7 +1140,7 @@ int btrfs_sync_file(struct file *file, int datasync)
 	/*
 	 * ok we haven't committed the transaction yet, lets do a commit
 	 */
-	if (file && file->private_data)
+	if (file->private_data)
 		btrfs_ioctl_trans_end(file);
 
 	trans = btrfs_start_transaction(root, 0);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-06-16 18:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29  9:49 [patch 11/11] btrfs: The file argument for fsync() is never null Dan Carpenter
2010-06-14 20:07 ` Johannes Hirte
2010-06-14 20:49   ` Dan Carpenter
2010-06-14 20:58   ` Christoph Hellwig
2010-06-14 21:11     ` Dan Carpenter
2010-06-14 21:16       ` Christoph Hellwig
2010-06-14 21:45         ` Johannes Hirte
2010-06-15  0:08           ` Chris Mason
2010-06-16 18:04             ` Johannes Hirte

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).