linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amit Sahrawat <amit.sahrawat83@gmail.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Issue with lazy umount and closing file descriptor in between
Date: Tue, 6 Sep 2011 22:56:41 +0530	[thread overview]
Message-ID: <CADDb1s1pLQMMipe-zoHM6u4C_ZmUm_r4rsYxfft9mFQ56+Wgaw@mail.gmail.com> (raw)

We have observed below issues in busybox umount:
1. force umount (umount -f): it does not work as expected.
2. lazy umount(umount -l): it detaches the mount point but waits for
current mount point users(processes) to finish.
Corruption happens when we powerdown, while lazy umount is waiting for
a process to finish.
(e.g. #dd if=/dev/zero of=/mnt/test.txt ).
What could be the ideal way so as to avoid file system corruption in
above scenario?
Is it fine to close all open file descriptors on umount system call
before attempting umount? But this results in OOPS in certain
situations like:
1. User app issue a write/read request
2. Write reaches in kernel space but sleeps for some time e.g. it is
not available in dentry cache.
3. In the meanwhile, we issue umount. This will close open file
descriptor, free file/dentry object and then umount.
4. Now write wakes up and finds NULL file/dentry object and triggers oops.
Please offer some advice on this issue.
Thanks & Regards,
Amit Sahrawat

             reply	other threads:[~2011-09-06 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 17:26 Amit Sahrawat [this message]
2011-09-07 16:37 ` Issue with lazy umount and closing file descriptor in between Amit Sahrawat
2011-09-10 11:18   ` NamJae Jeon
2011-09-11 18:23     ` Amit Sahrawat
2011-09-11 22:01   ` Bryan Donlan
2011-09-12  0:45     ` NamJae Jeon

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=CADDb1s1pLQMMipe-zoHM6u4C_ZmUm_r4rsYxfft9mFQ56+Wgaw@mail.gmail.com \
    --to=amit.sahrawat83@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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).