All of lore.kernel.org
 help / color / mirror / Atom feed
From: valdis.kletnieks@vt.edu (valdis.kletnieks at vt.edu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Modify a file content from block layer
Date: Mon, 22 Oct 2018 14:07:54 -0400	[thread overview]
Message-ID: <36619.1540231674@turing-police.cc.vt.edu> (raw)
In-Reply-To: <CAN-6CVmf-TfsGbto+pUWP=Lyp_Yd-BZCOPu6o2ofofsz0pgZAA@mail.gmail.com>

On Mon, 22 Oct 2018 22:32:14 +0530, jitendra kumar khasdev said:

> Working on a custom driver that tracks I/Os on block level. For some use
> case, I need to write metadata of tracked I/Os from driver in shutdown
> sequence (more likely in reboot handler). In reboot handler, performing I/O
> on disk is tricky (no userspace, no VFS. no sysfs).

Now take a step back.

What problem are you trying to solve by scribbling on blocks?  What's in the
metadata that (a) needs to be preserved and (b) can't be done by feeding it
to a userspace process?

Hint:  A number of dm targets need to track I/Os and manage to do so without
writing to a file system.

> Although, I am able to write one sector, by creating custom bio and giving
> manually sector to disk. Still, looking some correct API like
> *write_IO_on_disk(buffer, dev, offset, len)*

That's just *looking* for an fsck. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20181022/19a00d3b/attachment.sig>

      reply	other threads:[~2018-10-22 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22  8:26 Modify a file content from block layer jitendra kumar khasdev
2018-10-22 11:12 ` Ozgur
2018-10-22 11:38 ` valdis.kletnieks at vt.edu
2018-10-22 17:02   ` jitendra kumar khasdev
2018-10-22 18:07     ` valdis.kletnieks at vt.edu [this message]

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=36619.1540231674@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.