mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh MacDonald <jmacd@CS.Berkeley.EDU>
To: linux-kernel@vger.kernel.org
Cc: reiserfs-dev@namesys.com
Subject: Why is writepage() return value not used?
Date: Fri, 19 Oct 2001 12:05:44 -0700	[thread overview]
Message-ID: <20011019120544.G27824@helen.CS.Berkeley.EDU> (raw)

Reading through 2.4.12 sources, I observe that the two calls to
the address_space writepage() method, found in these functions:

	filemap_fdatasync
	shrink_cache

both ignore the return value.  For that matter, filemap_fdatasync
itself has no return value.  This seems to indicate that various
internal errors during fsync() will not result in an error to the
application.  Looking at some of the possible call graphs, such 
errors might occur in any of the write_full_page implementations,
including calls to:

	get_block()  (e.g., block_write_full_page, block_prepare_write)

	various EIO conditions, mostly sanity checks 
	(e.g., block_prepare_write, nfs_writepage, reiserfs, smbfs)

	calls to file_operations write() method though 
	nfs_writepage_sync

	ENOMEM condition (e.g., shmem_writepage)

My guess is that the file system's get_block() method usually 
cannot be called from within the block_write_full_page method 
during writepage, which is called directly by most file systems,
because the full page would have all its buffers mapped prior to
writepage().  Is this true?

However, NFS, ReiserFS, SMBFS, and shmem do not simply call
block_write_full_page() and each performs error checking in this code 
path.  It looks as if these errors will not reach the application
to which they belong when writepage() is called via fsync().  This
is definetly the case for ReiserFS, but I do not understand the
other systems well enough to evaluate their writepage() code path.

It looks less significant that shrink_cache() does not use the
return value, but if writepage() truly should have its return value
ignored then the declaration should not have it returning an int.

That would at least notify the file system authors that returning
an error condition does no good.

-josh

                 reply	other threads:[~2001-10-19 19:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011019120544.G27824@helen.CS.Berkeley.EDU \
    --to=jmacd@cs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-dev@namesys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®